Environment variables
Identity
Section titled “Identity”Generated API env parser, Drizzle Kit config, Vite build environment, and Sapporta CLI runtime.
Contract
Section titled “Contract”NODE_ENV=productionrequires verified email by default. Other values leave verification optional by default.SAPPORTA_PUBLIC_APP_URLis the browser-facing origin used for auth links, callbacks, and default trust.SAPPORTA_FRONTEND_ORIGINSadds exact credentialed browser origins.SAPPORTA_REQUIRE_VERIFIED_EMAIL=trueorfalseexplicitly overrides the environment-based email-verification default. An empty or absent value uses theNODE_ENVpolicy.SAPPORTA_HEALTH_POLICYconfigures health behavior.SAPPORTA_OPENAPI_POLICYacceptspublic,authenticated, ordisabled, and sets who may read the application contract at/api/openapi.json. An absent value meansauthenticated. The generated.env.developmentsetspublic, sosapporta endpoints listandendpoints showwork against a local development server with no access token. Deployments leave it unset or setauthenticated, and endpoint discovery there needs a token.SAPPORTA_MAIL_TRANSPORTacceptsstream,smtp, ordisabled;SAPPORTA_MAIL_FROMsupplies the sender.SAPPORTA_ALLOW_SAMPLE_DATA_SEEDING=truepermitspnpm seedto create the sample-data account named inpackages/api/seed.ts, and it also requiresNODE_ENVto be anything other thanproduction. The generated.env.developmentsets it. The permission is granted rather than merely not withheld: an environment that never heard of the setting is refused, so a staging box, a systemd unit, or CI against a restored snapshot is not taken for a developer’s machine. The account’s password is written in the source, so no deployment carries this setting.VITE_API_URLis public build-time configuration for a split API origin.SAPPORTA_API_URL,SAPPORTA_API_TOKEN, andSAPPORTA_OUTPUT_FORMATconfigure CLI calls.SAPPORTA_API_PORTselects the API listener port. Hosting-platformPORTis accepted when it is absent; both values must match when set together. The API defaults to3000when neither is set.SAPPORTA_FRONTEND_PORTselects the Vite development port.sapporta initpicks both development ports for the new project and writes them into.env.development, so that several Sapporta projects run on one machine without being reconfigured. A generated project’s development ports are therefore per-project, not the defaults above.pnpm devprints both as URLs when it starts.SAPPORTA_DATA_DIRnames the directory that holds the SQLite database,sqlite.db. It has no default: the server and Drizzle Kit both stop with an error when it is unset or empty. An absolute path is used as given. A relative path resolves against the project root, the directory withsapporta.json, and never against the working directory, sodatanames the same directory forpnpm dev, Drizzle Kit, and the built server. The directory must exist.sapporta initwritesSAPPORTA_DATA_DIR=datainto.env.development, so a copy of the project opens its own copy of the database.pnpm devandpnpm seedload that file. Thepnpm db:*scripts do not: they readSAPPORTA_DATA_DIRfrom the environment, the same way on a laptop and on a server, and stop when it is unset. Pass it on the command line in development:SAPPORTA_DATA_DIR=data pnpm --filter ./packages/api db:migrate.- The generated Docker image sets
SAPPORTA_DATA_DIR=/app/data. Every other deployment sets it in the server’s environment and in the environment of its migration job.
SAPPORTA_REQUIRE_VERIFIED_EMAIL accepts only the literal values true and
false when set.