Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Table } from "docs-ui"

export const metadata = {
title: `${pageNumber} Environment Variables in Admin Customizations`,
}
Expand Down Expand Up @@ -88,6 +90,70 @@ Learn more about other Vite environment variables in the [Vite documentation](ht

---

## Predefined Environment Variables

You can further customize the Medusa Admin behavior using the following predefined environment variables. You can set the environment variables in your `.env` file or in your deployment platform.

<Note>

The following pre-defined environment variables are available starting [Medusa v2.12.0](https://github.com/medusajs/medusa/releases/tag/v2.12.0).

</Note>

<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
Environment Variable
</Table.HeaderCell>
<Table.HeaderCell>
Description
</Table.HeaderCell>
<Table.HeaderCell>
Default
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>

`ADMIN_AUTH_TYPE`

</Table.Cell>
<Table.Cell>

A string indicating the authentication method that the JS SDK instance uses in the Medusa Admin. Possible values are `session` and `jwt`. Learn more in the [JS SDK Authentication guide](!resources!/js-sdk/auth/overview).

</Table.Cell>
<Table.Cell>

`session`

</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>

`ADMIN_JWT_TOKEN_STORAGE_KEY`

</Table.Cell>
<Table.Cell>

A string indicating the key used to store the authentication JWT token in the browser's local storage. Only applicable if `ADMIN_AUTH_TYPE` is set to `jwt`.

</Table.Cell>
<Table.Cell>

`medusa_auth_token`

</Table.Cell>
</Table.Row>
</Table.Body>
</Table>

---

## Environment Variables in Production

When you build the Medusa application, including the Medusa Admin, with the `build` command, the environment variables are inlined into the build. This means that you can't change the environment variables without rebuilding the application.
Expand Down
8 changes: 5 additions & 3 deletions www/apps/book/app/learn/fundamentals/admin/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The next chapters will cover these two topics in detail.

### What You Can't Customize in the Medusa Admin

You can't customize the admin dashboard's layout, design, or the content of the existing pages (aside from injecting widgets). You also can't customize the login page, the authentication flow, or change the Medusa logo used in the admin dashboard.
You can't customize the admin dashboard's layout, design, or the content of the existing pages (aside from injecting widgets). You also can't change the Medusa logo used in the admin dashboard.

If your use case requires heavy customization of the admin dashboard, you can build a custom admin dashboard using Medusa's [Admin API routes](!api!/admin).

Expand All @@ -51,6 +51,8 @@ Refer to the [Medusa UI documentation](https://docs.medusajs.com/ui) to learn ho

---

## Admin Components List
## Admin How-to Guides

To build admin customizations that match the Medusa Admin's designs and layouts, refer to [this guide](!resources!/admin-components) to find common components.
The [Admin How-to Guides](!resources!/how-to-tutorials#admin) provides guides that walk you through common admin customizations, such as [building common admin components](!resources!/admin-components), or [adding third-party authentication to the admin](!resources!/how-to-tutorials/how-to/admin/auth).

Refer to these guides for practical examples of customizing the Medusa Admin dashboard.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Learn more in the [Admin Environment Variables](../admin/environment-variables/p

## Predefined Medusa Environment Variables

The Medusa application uses the following predefined environment variables that you can set:
You can further customize the Medusa application behavior using the following predefined environment variables. You can set the environment variables in your `.env` file or in your deployment platform.

<Note title="Tip">

Expand Down Expand Up @@ -306,5 +306,39 @@ You should opt for setting configurations in `medusa-config.ts` where possible.
\-
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>

`ADMIN_AUTH_TYPE` ([v2.12.0+](https://github.com/medusajs/medusa/releases/tag/v2.12.0))

</Table.Cell>
<Table.Cell>

A string indicating the authentication method that the JS SDK instance uses in the Medusa Admin. Possible values are `session` and `jwt`. Learn more in the [JS SDK Authentication guide](!resources!/js-sdk/auth/overview).

</Table.Cell>
<Table.Cell>

`session`

</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>

`ADMIN_JWT_TOKEN_STORAGE_KEY` ([v2.12.0+](https://github.com/medusajs/medusa/releases/tag/v2.12.0))

</Table.Cell>
<Table.Cell>

A string indicating the key used to store the authentication JWT token in the browser's local storage. Only applicable if `ADMIN_AUTH_TYPE` is set to `jwt`.

</Table.Cell>
<Table.Cell>

`medusa_auth_token`

</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
6 changes: 3 additions & 3 deletions www/apps/book/generated/edit-dates.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const generatedEditDates = {
"app/learn/fundamentals/events-and-subscribers/emit-event/page.mdx": "2025-11-26T13:00:24.625Z",
"app/learn/fundamentals/workflows/conditions/page.mdx": "2025-09-04T15:57:00.934Z",
"app/learn/fundamentals/modules/module-link-directions/page.mdx": "2024-07-24T09:16:01+02:00",
"app/learn/fundamentals/admin/page.mdx": "2025-07-25T12:46:15.466Z",
"app/learn/fundamentals/admin/page.mdx": "2025-11-26T10:47:12.412Z",
"app/learn/fundamentals/workflows/long-running-workflow/page.mdx": "2025-08-01T07:16:21.736Z",
"app/learn/fundamentals/workflows/constructor-constraints/page.mdx": "2025-08-01T13:11:18.823Z",
"app/learn/fundamentals/data-models/write-migration/page.mdx": "2025-10-28T16:01:36.609Z",
Expand Down Expand Up @@ -92,7 +92,7 @@ export const generatedEditDates = {
"app/learn/introduction/architecture/page.mdx": "2025-07-18T15:52:35.513Z",
"app/learn/fundamentals/data-models/infer-type/page.mdx": "2025-03-18T07:41:01.936Z",
"app/learn/fundamentals/custom-cli-scripts/seed-data/page.mdx": "2025-09-15T16:02:51.362Z",
"app/learn/fundamentals/environment-variables/page.mdx": "2025-05-26T15:06:07.800Z",
"app/learn/fundamentals/environment-variables/page.mdx": "2025-11-26T11:05:38.863Z",
"app/learn/build/page.mdx": "2025-10-27T09:30:26.957Z",
"app/learn/deployment/general/page.mdx": "2025-10-21T07:39:08.998Z",
"app/learn/fundamentals/workflows/multiple-step-usage/page.mdx": "2025-08-01T14:59:59.501Z",
Expand All @@ -105,7 +105,7 @@ export const generatedEditDates = {
"app/learn/customization/reuse-customizations/page.mdx": "2025-09-04T15:45:52.047Z",
"app/learn/update/page.mdx": "2025-01-27T08:45:19.030Z",
"app/learn/fundamentals/module-links/query-context/page.mdx": "2025-09-15T16:09:58.104Z",
"app/learn/fundamentals/admin/environment-variables/page.mdx": "2025-08-01T13:16:25.172Z",
"app/learn/fundamentals/admin/environment-variables/page.mdx": "2025-11-26T08:24:17.689Z",
"app/learn/fundamentals/api-routes/parse-body/page.mdx": "2025-08-20T09:58:37.704Z",
"app/learn/fundamentals/admin/routing/page.mdx": "2025-07-25T07:35:18.038Z",
"app/learn/resources/contribution-guidelines/admin-translations/page.mdx": "2025-02-11T16:57:46.726Z",
Expand Down
Loading
Loading