Files
medusa-store/packages/admin/dashboard/src/lib/client/client.ts

16 lines
337 B
TypeScript

import Medusa from "@medusajs/js-sdk"
export const backendUrl = __BACKEND_URL__ ?? "/"
export const sdk = new Medusa({
baseUrl: backendUrl,
auth: {
type: "session",
},
})
// useful when you want to call the BE from the console and try things out quickly
if (typeof window !== "undefined") {
;(window as any).__sdk = sdk
}