Sistine Docs

Environment Variables

Complete reference for all environment variables.

Required Variables

These variables are required for the application to function:

Database

DATABASE_URL="postgresql://user:password@host/db?sslmode=require"

Authentication

BETTER_AUTH_SECRET="at-least-32-characters-random-key"
BETTER_AUTH_URL="http://localhost:3000"

Application URL

NEXT_PUBLIC_APP_URL="http://localhost:3000"

Service Integrations

Volcano Engine (AI Features)

Required for chat, image generation, and video generation:

VOLCANO_ENGINE_API_KEY="your-volcano-engine-api-key"
VOLCANO_ENGINE_API_URL="https://ark.cn-beijing.volces.com/api/v3"

Payments (Dodo Payments / Waffo)

Pick one provider with PAYMENTS_PROVIDER, then fill that provider's group. Both webhook routes stay live either way (/api/payments/{dodo,waffo}/webhook), because events for existing subscriptions must keep landing even after you switch.

PAYMENTS_PROVIDER="dodo"            # or "waffo"

# Dodo (test_mode until you go live)
DODO_PAYMENTS_API_KEY="..."
DODO_PAYMENTS_WEBHOOK_KEY="whsec_..."
DODO_PAYMENTS_ENVIRONMENT="test_mode"   # test_mode | live_mode

# Waffo
WAFFO_MERCHANT_ID="MER_..."
WAFFO_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----..."   # one-time download, never re-shown
WAFFO_STORE_ID="STO_..."
WAFFO_WEBHOOK_PUBLIC_KEY="-----BEGIN PUBLIC KEY-----..."
WAFFO_ENVIRONMENT="test"            # test | prod

Two things that silently break payments:

  • Fill a group completely or not at all. Half-configured provider = webhook signature failures, and pnpm doctor is what catches it.
  • WAFFO_WEBHOOK_PUBLIC_KEY is worth setting even though it is optional. The SDK falls back to a built-in key, and the built-in test key equals Waffo's real test key — so a missing variable has no symptoms in test mode and every event 401s in prod.

Run pnpm doctor (offline) or pnpm doctor:online (checks the product IDs actually exist at the provider) after editing.

Resend (Email)

Required for authentication emails and notifications:

RESEND_API_KEY="re_your_api_key"
RESEND_FROM_EMAIL="Your App <noreply@yourdomain.com>"

Google OAuth (Optional)

AUTH_GOOGLE_ID="your-google-client-id"
AUTH_GOOGLE_SECRET="your-google-client-secret"

Cron Jobs

CRON_SECRET="your-cron-secret"

Optional Analytics

NEXT_PUBLIC_POSTHOG_KEY="phc_..."
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID="G-..."
NEXT_PUBLIC_CLARITY_PROJECT_ID="..."

Optional Storage (S3-Compatible)

STORAGE_ENDPOINT="https://..."
STORAGE_BUCKET="your-bucket"
STORAGE_REGION="auto"
STORAGE_ACCESS_KEY_ID="..."
STORAGE_SECRET_ACCESS_KEY="..."
STORAGE_PUBLIC_URL="https://..."

On this page