feat: Add support for authentication to the sdk, and plug it in the admin (#7349)
* feat: Add support for authentication to the sdk, and plug it in the admin * fix: await fetch before returning in sdk
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import Medusa from "@medusajs/js-sdk"
|
||||
import { apiKeys } from "./api-keys"
|
||||
import { auth } from "./auth"
|
||||
import { campaigns } from "./campaigns"
|
||||
import { categories } from "./categories"
|
||||
import { collections } from "./collections"
|
||||
@@ -28,7 +28,6 @@ import { workflowExecutions } from "./workflow-executions"
|
||||
import { shippingProfiles } from "./shipping-profiles"
|
||||
|
||||
export const client = {
|
||||
auth: auth,
|
||||
apiKeys: apiKeys,
|
||||
campaigns: campaigns,
|
||||
categories: categories,
|
||||
@@ -57,3 +56,10 @@ export const client = {
|
||||
stockLocations: stockLocations,
|
||||
workflowExecutions: workflowExecutions,
|
||||
}
|
||||
|
||||
export const sdk = new Medusa({
|
||||
baseUrl: __BACKEND_URL__ || "http://localhost:9000",
|
||||
auth: {
|
||||
type: "session",
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user