Environment variables
View as MarkdownIdentity
Section titled “Identity”Generated API env parser, 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_REQUIRE_VERIFIED_EMAIL accepts only the literal values true and
false when set.