Environment Variables Reference

📦v1.0.0📅2026-04-28🔄Updated 2026-04-28👤Admin Team
administrationconfigurationenvironment-variables

Environment Variables Reference

All variables are set in .env (development) or Kubernetes ConfigMap/Secret (production). Variables marked Secret must never appear in ConfigMap or be committed to source control.


App

VariableDefaultDescription
NODE_ENVdevelopmentSet to production in production builds
PORT3000HTTP port the Next.js server listens on
NEXT_PUBLIC_APP_URLhttp://localhost:3000Public-facing URL (used in client-side code)

NextAuth

VariableDefaultRequiredSecret
NEXTAUTH_URLhttp://localhost:3000YesNo
NEXTAUTH_SECRET(none)YesYes
  • NEXTAUTH_URL must match the exact HTTPS URL that browsers use (including scheme and host). Mismatches break session cookies.
  • NEXTAUTH_SECRET must be at least 32 bytes. Generate with: openssl rand -base64 32.

MongoDB

VariableDefaultRequiredSecret
MONGODB_URImongodb://localhost:27018/core_adminYesYes
MONGODB_DBcore_adminYesNo
MONGO_ROOT_USER(none)Prod onlyYes
MONGO_ROOT_PASSWORD(none)Prod onlyYes

MONGODB_URI should include the database name and authentication credentials for production. The development default connects to the MongoDB container started by make dev.


Proxy (BFF → Proxy mTLS)

VariableDefaultRequiredSecret
PROXY_LOGIN_URLhttps://127.0.0.1:8088/api/v1/user/loginYesNo
PROXY_APP_ID2YesNo
PROXY_SERVER_NAMEproxy.localYesNo
PROXY_TLS_CERT_FILE./certs/client/core.crtYesNo
PROXY_TLS_KEY_FILE./certs/client/core.keyYesYes
PROXY_TLS_CA_FILE./certs/ca/ca.crtYesNo
BFF_PROXY_EMAIL(none)YesYes
BFF_PROXY_PASSWORD(none)YesYes

BFF_PROXY_EMAIL / BFF_PROXY_PASSWORD are the service account credentials used by the BFF to obtain a JWT from Proxy. They are not end-user credentials — they never appear in the UI and are cached in process memory only.


Core API

VariableDefaultRequiredSecret
CORE_API_URLhttp://localhost:8080YesNo
CORE_HEALTH_URLhttp://127.0.0.1:8092/healthYesNo
NEXT_PUBLIC_CORE_URL(none)NoNo
CORE_ADMIN_API_KEY(none)YesYes
CORE_TLS_CERT_FILE./certs/client/core.crtmTLS onlyNo
CORE_TLS_KEY_FILE./certs/client/core.keymTLS onlyYes
CORE_TLS_CA_FILE./certs/ca/ca.crtmTLS onlyNo
CORE_TLS_SERVER_NAMEcore.localmTLS onlyNo
  • CORE_API_URL: use https:// in production to enable mTLS. Automatically disables mTLS for http:// URLs.
  • CORE_HEALTH_URL: plain HTTP on port 8092 — no mTLS, separate from the admin API port. Intentionally kept HTTP so certificate issues don't make the health probe lie.
  • NEXT_PUBLIC_CORE_URL: shown to users in trigger-mode campaign integration snippets. Leave empty to display $CORE_URL as a placeholder.
  • CORE_ADMIN_API_KEY: sent as X-API-Key header to Core admin endpoints (/api/v1/admin/*, /api/v1/aerospike/*).

Core HTTP Client (Performance Tuning)

VariableDefaultDescription
CORE_HEADERS_TIMEOUT_MS30000Max time (ms) for Core to send the first response-header byte, including mTLS handshake
CORE_BODY_TIMEOUT_MS60000Max idle time (ms) between response body chunks for regular API calls
CORE_UPLOAD_BODY_TIMEOUT_MS1800000Max idle time (ms) between body chunks for file uploads (30 min — sized for 1 GB over 10 Mbit WAN)
CORE_AGENT_CONNECTIONS32Max concurrent keep-alive connections to Core per origin
CORE_MAX_RESPONSE_BYTES16777216Hard cap on response body size in bytes (16 MB default)

Tuning guidance:

  • Raise CORE_BODY_TIMEOUT_MS if fanout or large-list endpoints time out under load.
  • Lower CORE_AGENT_CONNECTIONS if Core is overloaded — the default 32 allows up to 32 simultaneous requests from the BFF.
  • CORE_MAX_RESPONSE_BYTES protects the Node.js heap. Admin fanout routes can override per-call up to 64 MB. Raise the default only if you see PAYLOAD_TOO_LARGE errors on standard list endpoints.

See Capacity Planning for sizing recommendations.


Upload

VariableDefaultDescription
UPLOAD_MAX_BYTES1073741824Server-side cap on recipient file uploads (1 GB). Governs POST /api/uploads for direct API callers only — the wizard UI enforces an independent 50 MB cap.

Uploads are streamed end-to-end (disk → Core) without accumulating the file in memory, so the cap is a policy choice rather than a memory constraint.


Audit

VariableDefaultDescription
AUDIT_RETENTION_DAYS90Days before audit log entries are automatically deleted by MongoDB's TTL index. Set to 0 to disable expiry.

After changing this variable, re-run make migrate — migration v6 idempotently recreates the TTL index with the new value. MongoDB does not update TTL indexes automatically.


Grafana

VariableDefaultDescription
GRAFANA_PUBLIC_URL(empty)Full URL of the Grafana dashboard to embed in /monitoring as an iframe. Leave empty to hide the monitoring section.

Grafana must have GF_SECURITY_ALLOW_EMBEDDING=true set for iframe embedding to work. The URL must be reachable from end-users' browsers (not just from the server).


Seed

VariableDefaultDescription
SEED_SUPER_ADMIN_EMAILadmin@example.comEmail address for the super admin account
SEED_SUPER_ADMIN_NAMESuper AdminDisplay name for the super admin account
SEED_SUPER_ADMIN_PASSWORD(auto-generated)Password — auto-generated and written back to .env if empty
SEED_DEFAULT_WORKSPACE_SLUGmainURL slug for the default workspace
SEED_DEFAULT_WORKSPACE_NAMEMainDisplay name for the default workspace

Feature Flags

VariableDefaultDescription
ADMIN_DIAGNOSTICS_ENABLEDfalseEnables the Aerospike diagnostics panel (/diagnostics/admin). Server-side check only.
GAP_TRACKER_URL(empty)URL for the 🚧 GapBadge popover (internal roadmap tracker). Leave empty to hide gap badges.

OpenAPI Codegen (Development Only)

VariableDefaultDescription
OPENAPI_SRC../../core/docs/openapi.yamlPath to the Core OpenAPI spec used by make sync-openapi. Only relevant for developers running codegen.

Next Steps