Skip to content

Environment Variables

Copy .env.example to .env and fill in the values. Variables prefixed with VITE_ are available on the client side. All others are server-only.

VariableDescriptionRequired
VITE_APP_URLBase URL of the app (e.g., http://localhost:3000)Yes
VITE_APP_NAMEApp name shown in the UIYes
VariableDescriptionRequired
DATABASE_URLPostgreSQL connection stringYes
VariableDescriptionRequired
BETTER_AUTH_SECRETRandom secret for signing sessions. Generate with openssl rand -base64 32Yes
BETTER_AUTH_URLAuth callback base URL (usually same as VITE_APP_URL)Yes
VariableDescriptionRequired
GITHUB_CLIENT_IDGitHub OAuth app client IDNo
GITHUB_CLIENT_SECRETGitHub OAuth app client secretNo
GOOGLE_CLIENT_IDGoogle OAuth credentials client IDNo
GOOGLE_CLIENT_SECRETGoogle OAuth credentials client secretNo

Create a GitHub OAuth app at github.com/settings/developers. Create Google credentials at the Google Cloud Console.

VariableDescriptionRequired
EMAIL_PROVIDEREmail driver to use (resend or sendgrid)Yes
EMAIL_FROMSender email addressYes
RESEND_API_KEYResend API keyIf using Resend
SENDGRID_API_KEYSendGrid API keyIf using SendGrid
VariableDescriptionRequired
S3_ENDPOINTS3-compatible endpoint URLYes
S3_ACCESS_KEY_IDS3 access keyYes
S3_SECRET_ACCESS_KEYS3 secret keyYes
S3_BUCKETPublic bucket nameYes
S3_PRIVATE_BUCKETPrivate bucket nameNo
S3_PUBLIC_URLPublic URL for the bucket (for constructing file URLs)Yes
VITE_STORAGE_URLClient-side storage URL (usually same as S3_PUBLIC_URL)Yes
VariableDescriptionRequired
PAYMENT_PROVIDERPayment driver to use (stripe)Yes
VITE_STRIPE_PUBLISHABLE_KEYStripe publishable key (client-side)Yes
STRIPE_SECRET_KEYStripe secret keyYes
STRIPE_WEBHOOK_SECRETStripe webhook signing secretYes
POLAR_ACCESS_TOKENPolar access tokenNo
POLAR_WEBHOOK_SECRETPolar webhook secretNo
POLAR_SERVERPolar server (sandbox or production)No