Reference
Environment variables
The variables of the template and the docs, and how they are loaded.
Environment files live in env/. nuxt.config.ts loads env/.env.<NODE_ENV> first and env/.env second, and a value set in the first file wins. Every NUXT_PUBLIC_* value reaches the browser: never put secrets in them.
cp env/.env.example env/.env
Template
Variable | Default | Use |
|---|---|---|
NUXT_PUBLIC_APP_NAME | BRAND_NAME | Overrides the brand name of config/brand.config.ts (sidebar, login, page titles) for one deployment. Leave it unset to use BRAND_NAME. |
NUXT_PUBLIC_SITE_URL | "" | The public URL, used by the landing SEO metadata, the structured data and the sitemap (empty while it is not set). |
NUXT_PUBLIC_API_BASE | "" | The base URL of useApi(). |
NUXT_PUBLIC_DEFAULT_CURRENCY | USD | The ISO 4217 currency of formatted amounts. |
NUXT_PUBLIC_DOCS_URL | http://localhost:3100 | The documentation URL. /docs redirects there and landing links to /docs point straight at it. |
NUXT_PUBLIC_DEMO_URL | "" | Only for a split deployment, on the sales page: landing links to app pages point at this URL. |
NUXT_PUBLIC_SALES_URL | "" | Only for a split deployment, on the demo: / redirects here, the demo bar links back here and every page sends X-Robots-Tag: noindex. |
NUXT_PUBLIC_MARKETPLACE_URL | "" | Only when you sell through a marketplace: its product page. The landing drops the items marked channel: direct and every buy button points here. See Sell on a marketplace. |
NODE_ENV | development | Picks the env/.env.<NODE_ENV> file. |
NITRO_PRESET | — | The deployment target of npm run build. |
Read them in code with useAppConfigEnv(), which returns siteUrl, appName, apiBase and defaultCurrency.
Documentation
Variable | Default | Use |
|---|---|---|
NUXT_PUBLIC_DOCS_NAME | melsami UI | The product name in the docs. |
NUXT_PUBLIC_DEMO_URL | http://localhost:3000 | Where the “Live demo” and “View in demo” links point. |
NUXT_PUBLIC_DOCS_REPO_URL | "" | When set, the source chips link to the file in your repository. |