Skip to main content
This page documents apps/api/.env.example, the SaaS distribution template (EDITION=saas). Validated by apps/api/src/config/env.ts — the API fails closed at boot in production if a required secret is missing. Enterprise self-hosted and enterprise_hybrid deployments use the same variable names but different infrastructure values; see Installation.
Never commit real values for anything marked Secret below. Production secrets should live in Cloudflare Worker secrets, your container platform’s secret store, or an equivalent customer-managed vault for enterprise self-hosted deployments.

Edition and runtime

Core infrastructure

System metadata and tenant data live in two physically separate Postgres databases — see Tenants & Data Boundaries. Each has an owner/admin URL (for migrations) and a restricted app-role URL (for runtime queries).

Auth

Public URLs and CORS

Object storage (S3-compatible / Cloudflare R2)

OCR

License signing (self-hosted license issuance)

File scanning and download gating

MFA

Turnstile (human verification)

Turnstile applies to public auth endpoints (register, redeem, login, password reset, invite accept). If you’re calling those endpoints directly instead of through the Deals/Console UI, see Authentication for how turnstileToken fits into each request.

Data handling / AI gateway

SSO (optional)

Configure providers in complete pairs — a half-configured pair is rejected in production, and a missing pair simply hides that provider from GET /auth/sso/providers. All *_SECRET / *_APP_SECRET values are secrets.

Email

Transactional mail (password reset, invitations, MFA backup codes) defaults to the Resend HTTP API — the only transport that’s safe from the Worker runtime, which cannot open raw TCP sockets.