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_SECRETCRON_SECRETDATABASE_URIELEVENLABS_API_KEYGOOGLE_GENERATIVE_AI_API_KEYNEXT_PUBLIC_BETTER_AUTH_URLNEXT_PUBLIC_SERVER_URLOPENAI_API_KEYPAYLOAD_DB_PUSHPAYLOAD_SECRETPG_POOL_MAXPREVIEW_SECRETRESEND_API_KEYS3_ACCESS_KEY_IDS3_BUCKETS3_ENDPOINTS3_PRIVATE_BUCKETS3_REGIONS3_SECRET_ACCESS_KEYSEED_USER_EMAILVISUAL_MATCHING_DEBUG_MODEZOHO_BILLING_ACCESS_TOKENZOHO_BILLING_ACCOUNTS_BASE_URLZOHO_BILLING_API_BASE_URLZOHO_BILLING_CLIENT_IDZOHO_BILLING_CLIENT_SECRETZOHO_BILLING_ORGANIZATION_IDZOHO_BILLING_REFRESH_TOKENZOHO_BILLING_WEBHOOK_SECRET
.env.example Gaps
Active .env includes these keys that are not currently listed in .env.example:
ELEVENLABS_API_KEYGOOGLE_GENERATIVE_AI_API_KEYOPENAI_API_KEYPAYLOAD_DB_PUSHPG_POOL_MAXSEED_USER_EMAILVISUAL_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.