chore: Configure auth on JS-SDK in dashboard (#14013)

* chore: Use env vars rather than configs

* Create wicked-turkeys-sell.md
This commit is contained in:
Oli Juhl
2025-11-11 11:15:58 +01:00
committed by GitHub
parent 2b6c39535f
commit c93f77d1b2
6 changed files with 35 additions and 5 deletions

View File

@@ -1,8 +1,13 @@
import Medusa from "@medusajs/js-sdk"
const backendUrl = __BACKEND_URL__ ?? "/"
const authType = __AUTH_TYPE__ ?? "session"
const jwtTokenStorageKey = __JWT_TOKEN_STORAGE_KEY__ || undefined
export const sdk = new Medusa({
baseUrl: __BACKEND_URL__ || "/",
baseUrl: backendUrl,
auth: {
type: "session",
type: authType,
jwtTokenStorageKey: jwtTokenStorageKey,
},
})

View File

@@ -1 +1,3 @@
declare const __BACKEND_URL__: string | undefined
declare const __AUTH_TYPE__: "session" | "jwt" | undefined
declare const __JWT_TOKEN_STORAGE_KEY__: string | undefined