Environment variables
Every environment variable the app reads, from .env.example and the code.
Every variable listed in .env.example or read as process.env.NAME in the app code (tests, scripts and the docs app excluded). Required is "yes" when the .env.example comment says so and empty when it says nothing; Purpose is that comment. Variables read under a computed name are not listed. What each variable does and when you need it: Configuration reference.
59 variables.
| Variable | Required | In .env.example | Purpose | Read in |
|---|---|---|---|---|
ANTHROPIC_API_KEY | yes | AI. Leave empty to use keys saved in the admin panel. | lib/enrichment/e2b/agent-script.ts | |
BETTER_AUTH_SECRET | yes | Better Auth | lib/auth.ts | |
BETTER_AUTH_URL | yes | Better Auth | lib/auth.ts, proxy.ts | |
CI | no | prisma/seeds/seed.ts | ||
COMPANY_NAME | no | lib/enrichment/e2b/agent-script.ts | ||
COMPANY_WEBSITE | no | lib/enrichment/e2b/agent-script.ts | ||
DATABASE_URL | yes | yes | PostgreSQL connection string (required). Default: the local Docker Postgres from docker-compose.dev.yml (pnpm db:up). | lib/prisma-base.ts, prisma/seeds/seed.ts |
E2B_API_KEY | no | inngest/functions/enrich-target-contact.ts, inngest/functions/enrich-target.ts, lib/enrichment/target-enrichment-keys.ts | ||
E2B_ENRICHMENT_TEMPLATE | no | inngest/functions/enrich-target-contact.ts, inngest/functions/enrich-target.ts | ||
EMAIL_ENCRYPTION_KEY | yes | Encrypts stored mailbox passwords and API keys — generate with: openssl rand -hex 32 Set once and never change it, or the stored values become unreadable. | lib/email-crypto.ts | |
EMAIL_FROM | yes | verified sender for login codes, e.g. noreply@yourdomain.com | actions/admin/send-mail-to-all/index.ts, actions/admin/users/activate-user.ts, actions/admin/users/invite-user.ts +15 more | |
EMAIL_HOST | no | lib/sendmail.ts | ||
EMAIL_PASSWORD | no | lib/sendmail.ts | ||
EMAIL_USERNAME | no | lib/sendmail.ts | ||
FIRECRAWL_API_KEY | yes | get from https://firecrawl.dev | ||
GOOGLE_CALENDAR_CLIENT_ID | yes | Google Calendar sync — Workspace-internal OAuth app | lib/crm/calendar/google.ts | |
GOOGLE_CALENDAR_CLIENT_SECRET | yes | Google Calendar sync — Workspace-internal OAuth app | lib/crm/calendar/google.ts | |
GOOGLE_ID | yes | Google OAuth | lib/auth.ts | |
GOOGLE_SECRET | yes | Google OAuth | lib/auth.ts | |
HOME | no | lib/enrichment/e2b/agent-script.ts | ||
INNGEST_APP_NAME | no | inngest/client.ts | ||
INNGEST_EVENT_KEY | no | inngest/client.ts | ||
INNGEST_ID | no | inngest/client.ts | ||
INNGEST_SIGNING_KEY | no | inngest/client.ts | ||
KNOWN_DOMAIN | no | lib/enrichment/e2b/agent-script.ts | ||
MAILTRAP_API_KEY | no | lib/mailtrap.ts | ||
MAIL_ALLOW_PRIVATE_HOSTS | no | lib/net/host-guard.ts | ||
MINIO_ACCESS_KEY | yes | MinIO / S3 object storage MINIO_ENDPOINT is what the server uses; MINIO_PUBLIC_ENDPOINT is what browsers use (presigned uploads and file links). Leave it empty when both are the same URL. | lib/minio.ts | |
MINIO_BUCKET | yes | MinIO / S3 object storage MINIO_ENDPOINT is what the server uses; MINIO_PUBLIC_ENDPOINT is what browsers use (presigned uploads and file links). Leave it empty when both are the same URL. | lib/minio.ts | |
MINIO_ENDPOINT | yes | MinIO / S3 object storage MINIO_ENDPOINT is what the server uses; MINIO_PUBLIC_ENDPOINT is what browsers use (presigned uploads and file links). Leave it empty when both are the same URL. | lib/minio.ts | |
MINIO_PUBLIC_ENDPOINT | yes | MinIO / S3 object storage MINIO_ENDPOINT is what the server uses; MINIO_PUBLIC_ENDPOINT is what browsers use (presigned uploads and file links). Leave it empty when both are the same URL. | ||
MINIO_SECRET_KEY | yes | MinIO / S3 object storage MINIO_ENDPOINT is what the server uses; MINIO_PUBLIC_ENDPOINT is what browsers use (presigned uploads and file links). Leave it empty when both are the same URL. | lib/minio.ts | |
NEXTCRM_E2E_TEST_OTP | yes | Dev/e2e only: capture sign-in OTPs and serve them at /api/auth/test-otp (1 = yes). Ignored when NODE_ENV=production. Never set it on a shared or deployed instance. | lib/test-otp.ts | |
NEXTCRM_TOKEN | no | app/api/crm/contacts/create-from-remote/route.ts, app/api/crm/leads/create-lead-from-web/route.ts | ||
NEXT_PUBLIC_APP_DOMAIN | no | actions/invoices/send-invoice-email.ts | ||
NEXT_PUBLIC_APP_NAME | no | actions/admin/send-mail-to-all/index.ts, actions/admin/users/activate-user.ts, actions/admin/users/invite-user.ts +27 more | ||
NEXT_PUBLIC_APP_URL | no | actions/admin/users/activate-user.ts, actions/crm/opportunities/approval.ts, actions/feedback/send-feedback.ts +26 more | ||
NEXT_PUBLIC_DISCORD_INVITE_URL | no | components/support.tsx | ||
NEXT_PUBLIC_GITHUB_ISSUES_URL | no | components/support.tsx | ||
NEXT_PUBLIC_GITHUB_REPO_API | no | actions/github/get-repo-stars.ts | ||
NEXT_PUBLIC_GITHUB_REPO_URL | no | app/[locale]/(auth)/layout.tsx | ||
NEXT_PUBLIC_GITHUB_TOKEN | no | actions/github/get-repo-stars.ts | ||
NEXT_PUBLIC_NEXT_VERSION | no | app/[locale]/(routes)/components/Footer.tsx | ||
NEXT_RUNTIME | no | instrumentation.ts | ||
NODE_ENV | no | app/api/profile/calendar-connections/google/authorize/route.ts, app/api/profile/calendar-connections/google/callback/route.ts, lib/auth.ts +4 more | ||
OPENAI_API_KEY | yes | AI. Leave empty to use keys saved in the admin panel. | inngest/functions/documents/enrich-document.ts, inngest/lib/embedding-utils.ts | |
PATH | no | lib/enrichment/e2b/agent-script.ts | ||
PLUGIN_HTTP_ALLOW_PRIVATE_HOSTS | no | lib/plugins/http.ts | ||
PLUGIN_HTTP_HOST_MAP | yes | Plugin HTTP: dial these hosts at a fixed IP ("host=ip[,host=ip]"), private or not, e.g. the Docker gateway when the server cannot reach its own public IP. TLS and the Host header keep the hostname. Only listed hosts skip the private-address check. | lib/plugins/http.ts | |
RESEND_API_KEY | yes | Email Service (Resend). Leave the key empty to use the one saved in Admin > Resend; an env value always wins over the admin panel. | inngest/functions/crm/kill-rule.ts, inngest/functions/crm/recycle-targets.ts, lib/crm/auto-task.ts | |
RESEND_FROM_EMAIL | yes | e.g. noreply@yourdomain.com | inngest/functions/campaigns/send-step.ts, inngest/functions/crm/kill-rule.ts, inngest/functions/crm/recycle-targets.ts +2 more | |
RESEND_WEBHOOK_SECRET | yes | Resend webhook signing secret (whsec_…, Svix-signed) | lib/campaigns/resend-signature.ts | |
SEED_CONTACT_EMAIL | no | prisma/seeds/seed.ts | ||
SEED_DEMO_DATA | yes | Seed the demo CRM dataset on pnpm db:seed (1 = yes) | prisma/seeds/seed.ts | |
SKIP_ENV_VALIDATION | no | instrumentation.ts | ||
TARGET_EMAIL | no | lib/enrichment/e2b/agent-script.ts | ||
TARGET_NAME | no | lib/enrichment/e2b/agent-script.ts | ||
TEST_USER_EMAIL | no | prisma/seeds/seed.ts | ||
UPSTASH_REDIS_REST_URL | no | lib/enrichment/rate-limit.ts |