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:
@@ -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,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
declare const __BACKEND_URL__: string | undefined
|
||||
declare const __AUTH_TYPE__: "session" | "jwt" | undefined
|
||||
declare const __JWT_TOKEN_STORAGE_KEY__: string | undefined
|
||||
|
||||
Reference in New Issue
Block a user