Environment Variables
The starter kit gives you a ready .env, so you rarely need to set these by hand. Hosting sets its own values. env.sample in the repository is the reference.
Never print, paste or commit .env, because it holds the site’s build login. Anything starting with NEXT_PUBLIC_ ends up in the browser, so keep secrets out of those.
Data service
| Variable | Required | Description |
|---|---|---|
GODAAS_URL | Yes | GoDaaS’s address, with no trailing slash. Without it, reads come back empty with a warning. |
GODAAS_EMAIL, GODAAS_PASSWORD | Yes, or a token | The site’s read-only account. It can’t use two-factor authentication. |
GODAAS_STATIC_TOKEN | Instead of the above | A static token. If both are set, the email and password win. |
GODAAS_RESOURCE_URI | Yes | The site’s URI, from Site details → Resource URI in Visor’s switcher. It limits reads to this site, and without it reads are refused. |
GODAAS_TENANT_ID | If the account is in several organizations | The organization’s ID. The kit always sets it. |
GODAAS_MAX_RPS | No | Requests started per second, per process. The default is 10. |
GATEWAY_KEY | Only behind a gateway | Sent with server requests when your deployment requires it. |
Visor and build
| Variable | Required | Description |
|---|---|---|
NEXT_PUBLIC_BUILD_MODE | Yes | ssr or ssg. See Rendering modes. |
NEXT_PUBLIC_VISOR_URL | Yes | Visor’s address, or several separated by commas. The website trusts editor messages only from these, and without it, it accepts any origin. |
VISOR_FRONTEND_ID | Set by hosting | Which frontend this website is. Unset, it follows the site’s active frontend. It isn’t in the kit’s .env. |
NEXT_PUBLIC_SUB_SITE | No | A path prefix for a live website hosted below a domain’s root. ssg only. |
Files
| Variable | Required | Description |
|---|---|---|
NEXT_PUBLIC_FILE_URL | No | A public bucket’s address for files. When empty, the live build downloads files into its output. Preview always uses Visor’s image route. |
USE_SUPABASE_FILE_VERSIONING | No | Adds a version to public file addresses. It has no effect when NEXT_PUBLIC_FILE_URL is empty, or on preview. |
Optional features
| Variable | Description |
|---|---|
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY | For the faceted search’s map. |
NEXT_PUBLIC_SITE_URL | The website’s address, for language links in search engines. |
Things that aren’t variables
- Google Analytics: set the GA4 ID on the frontend’s settings. It’s added to the live website only, at its next Deploy.
- Chocolate Factory: the widget reads the frontend’s configuration in Visor. See Chocolate Factory Integration.
Older settings
If you’re updating an older site:
| Old variable | Now |
|---|---|
NEXT_PUBLIC_DAAS_URL | Removed. Use GODAAS_URL, which is server-only. |
DAAS_STATIC_TOKEN | Use GODAAS_EMAIL and GODAAS_PASSWORD, or GODAAS_STATIC_TOKEN. |
NEXT_PUBLIC_TENANT_ID | Not needed. GODAAS_RESOURCE_URI limits reads to the site. |
Last updated on