Skip to main content

Configuration and environment variables

Bunway favors environment variables plus small application-owned TypeScript files. Restart processes after changing .env. Empty provider values are not secrets and are safe in .env.example.

GroupVariableRequired/default
CorePORTAPI port; 3000
CoreCORS_ORIGINBrowser origin; http://localhost:5173
CoreDEBUGShow unexpected CLI stack traces when truthy
DatabaseDATABASE_URLRequired for primary PostgreSQL/MySQL; SQLite has a file default
Database<NAME>_DATABASE_URLRequired for named PostgreSQL/MySQL databases
GeneratorsBUNWAY_ID_TYPEuuid; alternatives integer, bigint
GeneratorsBUNWAY_ID_ENCODINGstandard; alternative base64url for UUIDs
JobsBUNWAY_JOBS_DATABASENamed PostgreSQL database; primary
JobsQUEUESComma-separated worker queues; all/default behavior when omitted
AuthBETTER_AUTH_SECRETRequired in production; at least 32 random characters
AuthBETTER_AUTH_URLAPI origin; http://localhost:3000
AuthWEB_ORIGINtrusted frontend/WebAuthn origin; http://localhost:5173
AuthAUTH_APP_NAMEdisplay name; Bunway App
AuthAUTH_RP_IDpasskey relying-party ID; localhost
OAuth<PROVIDER>_CLIENT_ID, <PROVIDER>_CLIENT_SECRETRequired only for selected real provider
StorageSTORAGE_SERVICElocal; alternative s3
StorageSTORAGE_PATHlocal root; storage
StorageSTORAGE_PUBLIC_URLpublic object base URL; local API storage URL by default
S3STORAGE_BUCKET, STORAGE_ACCESS_KEY_ID, STORAGE_SECRET_ACCESS_KEYRequired for S3
S3STORAGE_ENDPOINT, STORAGE_REGIONEndpoint/region for S3-compatible service
MailMAIL_DRIVERdevelopment infers console; production requires resend or smtp
MailMAIL_FROMRequired by Resend/SMTP unless each message supplies from
ResendRESEND_API_KEYRequired for MAIL_DRIVER=resend
SMTPSMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASSWORD, SMTP_SECURESMTP configuration; port 587, secure false
SMSSMS_DRIVERdevelopment infers console; production requires twilio
TwilioTWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, TWILIO_FROMRequired for Twilio delivery

Google, GitHub, Microsoft, and Apple use uppercase provider prefixes. Selected OAuth providers with missing credentials are disabled with guidance in development; production messaging never falls back to console. Audit has no environment configuration because its generated recorder imports the selected database explicitly.

Database topology lives in src/db/config.ts; provider selection lives in generated application code. See Databases, Authentication, and Messaging.