DDARE Docs
Frontend

Frontend Configuration

Vite environment variables and per-environment frontend settings.

The DARE frontend reads configuration from .env files at build time via Vite. All variables exposed to the browser must be prefixed VITE_.

A working template lives at .env.example — copy it to .env and edit.

Important: Vite inlines VITE_* values into the bundle at build time. Changing them after npm run build requires rebuilding and redeploying. For per-environment configuration, pass values as Docker build args or set them in your CI environment before npm run build.


Core

VariableTypeDefaultDescription
VITE_APP_ENVIRONMENTstringdevelopmentFree-form label (development, staging, production). Used for runtime gating and Sentry release tagging.

Backend Connection

VariableTypeDefaultDescription
VITE_DJANGO_BACKEND_URLurlhttp://localhost:8000Base URL of the DARE REST API. Must be reachable from the browser.
VITE_WEBSOCKET_URLurlws://localhost:8000Socket.IO server origin for chat and workflow streaming. Use wss:// when the page is served over HTTPS. The Socket.IO client adds namespaces such as /chat and /workflow.

Feature Flags

VariableTypeDefaultDescription
VITE_ENABLE_MCPboolfalseEnables the Model Context Protocol panel in the UI. Requires the backend's MCP integration to be configured.
VITE_ENABLE_MEMORYboolfalseEnables the long-term memory feature in conversations.

Observability (Sentry)

VariableTypeDefaultDescription
VITE_SENTRY_DSNstring(none)Sentry DSN. Empty disables client-side Sentry.

Do not put Sentry auth tokens in VITE_* variables. Values prefixed with VITE_ are exposed to the browser bundle. If source-map upload is added later, use non-VITE_ CI secrets.


Per-environment configuration

Vite supports mode-specific env files:

FileLoaded for
.envalways
.env.localalways; gitignored — overrides .env
.env.developmentnpm run dev
.env.productionnpm run build

A common setup:

  • Commit .env.example (the template).
  • Commit .env.development (safe, points at localhost).
  • Do not commit .env, .env.local, or production .env files.
  • Set production vars via your CI / deploy environment.

Adding a new variable

  1. Add it to .env.example with a placeholder.
  2. Read it via import.meta.env.VITE_MY_VAR in the code (no extra wiring required).
  3. If it's a feature flag, prefer adding it to src/config/ so call sites can import a typed featureFlags object rather than reaching into import.meta.env directly.
  4. Document it in this file.

Example:

// src/config/featureFlags.ts
export const featureFlags = {
  mcp: import.meta.env.VITE_ENABLE_MCP === 'true',
  memory: import.meta.env.VITE_ENABLE_MEMORY === 'true',
}

Validating configuration

After editing .env, run:

npm run build       # confirm there are no missing-env warnings
npm run preview     # confirm the build runs locally

In the browser console of a running build:

// All inlined VITE_* values are visible on import.meta.env at runtime.
// (Visible to anyone using the app — never put secrets here.)

Security notes

  • No secrets in VITE_* variables. Anything prefixed VITE_ is shipped to the browser in plain text. API keys, internal hostnames, and similar belong on the backend.
  • Auth tokens are stored in browser storage by the auth flow — they are not configured via env vars.

On this page