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:
Stevche Radevski
2024-05-17 14:37:38 +02:00
committed by GitHub
parent ff337498a0
commit 00a37cede1
13 changed files with 207 additions and 133 deletions

View File

@@ -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",
},
})