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
@@ -94,3 +94,11 @@ In the `medusa-config.ts` file of your Medusa application, you'll find a `loadEn
This function is responsible for loading the correct `.env` file based on the value of `process.env.NODE_ENV`.
To ensure that the correct `.env` file is loaded as shown in the table above, only specify `development`, `production`, `staging` or `test` as the value of `process.env.NODE_ENV` or as the parameter of `loadEnv`.
---
## Environment Variables for Admin Customizations
Since the Medusa Admin is built on top of [Vite](https://vite.dev/), you prefix the environment variables you want to use in a widget or UI route with `VITE_`. Then, you can access or use them with the `import.meta.env` object.
Learn more in [this documentation](../admin/environment-variables/page.mdx).