Skip to Content
Developer GuideEnvironment Variables

Environment Variables

All configuration is done via environment variables. Create a .env.local file in the project root (this file is ignored by git and overrides .env).

# .env.local NEXT_PUBLIC_DAAS_URL=https://your-daas.example.com DAAS_STATIC_TOKEN=your-static-token-here NEXT_PUBLIC_VISOR_URL=https://your-visor-studio.example.com NEXT_PUBLIC_TENANT_ID=your-tenant-uuid-here NEXT_PUBLIC_BUILD_MODE=ssr NEXT_PUBLIC_FILE_URL=https://your-cdn.example.com USE_SUPABASE_FILE_VERSIONING=true

Variable Reference

VariableRequiredDescription
NEXT_PUBLIC_DAAS_URL✅ YesBase URL of the DaaS (Data as a Service) API. All content, layout, and site configuration is fetched from this endpoint.
DAAS_STATIC_TOKEN✅ YesBearer token used to authenticate requests to the DaaS API. Obtain this from your Visor Studio admin.
NEXT_PUBLIC_VISOR_URL✅ YesURL of the Visor Studio admin interface. Used as the trusted postMessage origin for Dev Mode — ensures widget configuration messages are only accepted from your Visor instance.
NEXT_PUBLIC_TENANT_ID✅ YesUUID of your tenant in Visor Studio. Determines which site configuration, layouts, and pages are loaded. Found in Visor Studio under Settings → Sites.
NEXT_PUBLIC_BUILD_MODE✅ YesRendering strategy: ssr, ssg, or isr. Controls which page files are active after running prebuild. See Rendering Modes.
NEXT_PUBLIC_SUB_SITE⬜ OptionalSub-path prefix for SSG deployments hosted at a sub-path (e.g. /my-site). Applied as basePath and assetPrefix in next.config.mjs. Only used when NEXT_PUBLIC_BUILD_MODE=ssg.
NEXT_PUBLIC_FILE_URL=⬜ OptionalBase URL for static assets (images, videos, etc.) hosted outside of the DaaS. If not set, assets are served from the DaaS.
USE_SUPABASE_FILE_VERSIONING=⬜ OptionalIf set to true, the template will append a version query parameter to all static asset URLs

All NEXT_PUBLIC_* variables are embedded into the browser bundle at build time. Do not store secrets or private keys in these variables — use server-only environment variables (without the NEXT_PUBLIC_ prefix) for anything sensitive.

DAAS_STATIC_TOKEN

This token authenticates all requests to the DaaS API. Every request from Visor Studio requires this token. The token is kept private to prevent exposure in SSG builds.

NEXT_PUBLIC_DAAS_URL

The DaaS URL is the backbone of the template. Every page load triggers requests to this URL to fetch:

  • Page content and widget parameters
  • Layout and placeholder configuration
  • Site settings and active theme path

If this is not set or the server is unreachable, the template will return empty pages and log warnings — it does not crash on connection failures.

NEXT_PUBLIC_VISOR_URL

This URL is used for Dev Mode (the live-editing interface in Visor Studio). The frontend and Visor Studio communicate via window.postMessage — NEXT_PUBLIC_VISOR_URL is the allowed message origin. If this is incorrect, widget configuration panels in Dev Mode will not receive updates from the editor.

NEXT_PUBLIC_TENANT_ID

Each Visor Studio deployment can host multiple tenants. The tenant ID is a UUID that scopes all data queries to the correct team. You can find your tenant ID in Visor Studio under Settings → Sites → select your site.

NEXT_PUBLIC_BUILD_MODE

Controls which rendering strategy is used:

ValueOutput formatWhen to use
ssrstandalone serverLive sites, frequently changing content
ssgStatic export (HTML files)Content-stable or CDN-hosted sites
isrstandalone server + background revalidationBalance between freshness and performance

Changing this value only takes effect after running npm run prebuild, which calls scripts/switchPage.js to copy the correct mode-specific page files into place.

NEXT_PUBLIC_FILE_URL

if empty, static assets are served as base64-encoded data. if set, static assets are served from the specified URL. This is useful for hosting large media files on a CDN or external storage.

Public File URL

only affects ssg builds, as ssr and isr always fetch assets from the DaaS.

USE_SUPABASE_FILE_VERSIONING

This variable complements NEXT_PUBLIC_FILE_URL. When set to true, the template appends a version to the filename (e.g., image.jpg/1234567890). The case is when you use 3rd party storage instead of the default DaaS storage.

File Versioning

only affects ssg builds, as ssr and isr always fetch assets from the DaaS.

Last updated on