docs: document admin environment variables (#11313)

This commit is contained in:
Shahed Nasser
2025-02-05 11:47:07 +02:00
committed by GitHub
parent 98236c8262
commit d348204fe5
12 changed files with 127 additions and 22 deletions
@@ -156,8 +156,8 @@ If you didn't follow the [previous chapter](../widget/page.mdx), create the file
import Medusa from "@medusajs/js-sdk"
export const sdk = new Medusa({
baseUrl: "http://localhost:9000",
debug: process.env.NODE_ENV === "development",
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
debug: import.meta.env.DEV,
auth: {
type: "session",
},
@@ -170,6 +170,8 @@ You initialize the SDK passing it the following options:
- `debug`: Whether to enable logging debug messages. This should only be enabled in development.
- `auth.type`: The authentication method used in the client application, which is `session` in the Medusa Admin dashboard.
Notice that you use `import.meta.env` to access environment variables in your customizations because the Medusa Admin is built on top of Vite. Learn more in [this chapter](../../../fundamentals/admin/environment-variables/page.mdx).
You can now use the SDK to send requests to the Medusa server.
<Note>