Skip to content

Environment And Services

Last refreshed: 2026-05-21

Source Of Truth

Start from .env.example, but verify active .env for local assumptions. Do not copy secret values into docs, logs, or commits.

Active Environment Keys Observed

Active .env currently includes:

  • BETTER_AUTH_SECRET
  • CRON_SECRET
  • DATABASE_URI
  • ELEVENLABS_API_KEY
  • GOOGLE_GENERATIVE_AI_API_KEY
  • NEXT_PUBLIC_BETTER_AUTH_URL
  • NEXT_PUBLIC_SERVER_URL
  • OPENAI_API_KEY
  • PAYLOAD_DB_PUSH
  • PAYLOAD_SECRET
  • PG_POOL_MAX
  • PREVIEW_SECRET
  • RESEND_API_KEY
  • S3_ACCESS_KEY_ID
  • S3_BUCKET
  • S3_ENDPOINT
  • S3_PRIVATE_BUCKET
  • S3_REGION
  • S3_SECRET_ACCESS_KEY
  • SEED_USER_EMAIL
  • VISUAL_MATCHING_DEBUG_MODE
  • ZOHO_BILLING_ACCESS_TOKEN
  • ZOHO_BILLING_ACCOUNTS_BASE_URL
  • ZOHO_BILLING_API_BASE_URL
  • ZOHO_BILLING_CLIENT_ID
  • ZOHO_BILLING_CLIENT_SECRET
  • ZOHO_BILLING_ORGANIZATION_ID
  • ZOHO_BILLING_REFRESH_TOKEN
  • ZOHO_BILLING_WEBHOOK_SECRET

.env.example Gaps

Active .env includes these keys that are not currently listed in .env.example:

  • ELEVENLABS_API_KEY
  • GOOGLE_GENERATIVE_AI_API_KEY
  • OPENAI_API_KEY
  • PAYLOAD_DB_PUSH
  • PG_POOL_MAX
  • SEED_USER_EMAIL
  • VISUAL_MATCHING_DEBUG_MODE

Update .env.example when formalizing provider or worker setup.

The external render worker API now expects ANUVA_WORKER_API_TOKEN to be defined in environments that serve /api/worker/v1.

Services

  • Postgres: Payload, app data, Mastra storage.
  • S3-compatible storage: public/private media and uploads.
  • Worker API auth: bearer token from ANUVA_WORKER_API_TOKEN.
  • Resend: email delivery.
  • OpenAI: text, web search, embeddings, image generation.
  • Google Generative AI: provider key present; verify specific use before depending on it.
  • ElevenLabs: TTS/audio generation.
  • Zoho Billing: plans, customers, credit pack purchases, webhooks, reconciliation.
flowchart TD
  env[".env"] --> next["Next.js runtime"]
  env --> workers["Worker scripts"]
  env --> payload["Payload config"]
  next --> postgres["🗄️ Postgres"]
  next --> storage["🪣 S3 storage"]
  next --> providers["✨ AI providers"]
  next --> email["✉️ Resend"]
  next --> billing["💳 Zoho Billing"]
  workers --> postgres
  workers --> providers
  payload --> postgres

Payload DB Push

PAYLOAD_DB_PUSH=1 enables Payload schema push. The Payload config raises PG_POOL_MAX behavior for push-mode startup to avoid low-pool issues. Use carefully against hosted databases.

When DATABASE_URI points at a Supabase pooler host, the app now ignores PAYLOAD_DB_PUSH=1 and keeps push disabled. Use a direct Postgres connection, not the pooler endpoint, for schema push or Drizzle introspection work.

Schema changes therefore need an explicit migration path in pooler-backed environments. After pulling schema-changing code, run pnpm payload migrate against a database connection that can execute DDL before expecting Payload admin or route handlers to reflect the new collection shape.

Local Environment Note

Do not infer active services from old local-infrastructure assumptions. In this workspace, .env points to hosted services.