Environment variables

Copy .env.example to .env.local for local work, or add these to your host.

Required

VariablePurpose
BETTER_AUTH_SECRETSigns session cookies; 32+ random bytes.
BETTER_AUTH_URLPublic URL of the app, e.g. https://assay.example.com.
GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRETGoogle OAuth client; callback /api/auth/callback/google.
GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRETGitHub OAuth app; callback /api/auth/callback/github.
MONGODB_URIMongoDB connection string. The database is the one named in its path, else MONGODB_DB_NAME, else sql_script_monitoring; users, roles, checks and runs all live there.
RUN_RETENTION_DAYSDays a run is kept (default 90; 0 keeps runs forever).
DATABASE_URLThe PostgreSQL database checks run against.
UPSTASH_REDIS_REST_URLUpstash Redis REST URL.
UPSTASH_REDIS_REST_TOKENUpstash Redis REST token.

Optional

VariablePurpose
AI_ENABLEDtrue turns on the AI assistant. Off by default, because every request spends AI Gateway credits.
AI_GATEWAY_API_KEYAI Gateway key for hosts other than Vercel. On Vercel the gateway authenticates with OIDC and no key is needed.
AI_GATEWAY_MODELOverrides the default model, as a provider/model id.
DEMO_MODEtrue makes the workspace a public demo: viewers may run the seeded demo checks, 20 runs per hour each, and visitors can try it as guests without an account (see Accounts and roles). Leave unset otherwise.
CHECK_TIMEOUT_MSHow long one statement of a check may run before PostgreSQL stops it. Default 30000 (30 s), at most 300000.
CHECK_CONCURRENCYHow many checks one server instance runs at the same time. Default 4.
ALLOWED_EMAIL_DOMAINSComma-separated email domains allowed to sign in. Empty allows everyone.
CA_CERT_BLOB_URLhttps:// URL of the CA certificate PostgreSQL's server certificate is verified against. With CLIENT_CERT_BLOB_URL and CLIENT_KEY_BLOB_URL, also a client certificate.

See also