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.
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 fromGET /auth/sso/providers.
All
*_SECRET / *_APP_SECRET values are secrets.