Environment variables
Every variable an Intelligo app reads: the two it cannot boot without, and the ones that switch on email, OAuth, Stripe, the cron and the admin console.
intelligo create writes these to .env.example; copy it to .env.local and fill it in. intelligo doctor reports what is still missing, and the app refuses to boot without the required ones rather than failing when a feature is first used. AUTH_SECRET is accepted as a legacy alias of BETTER_AUTH_SECRET.
Required — the app will not boot without these
| Variable | What it is |
|---|---|
DATABASE_URL |
Postgres with the pgvector extension (Neon, Supabase, RDS, or local). |
INTELLIGO_DB_DRIVER |
Optional. Driver is chosen from the URL (Neon hosts get the WebSocket driver, everything else node-postgres). Force it with pg | neon-serverless. |
DATABASE_POOL_MAX |
Optional. Connections the pool may open per server process (default 10). A request waits at most 15 seconds for one before it fails. |
BETTER_AUTH_SECRET |
At least 32 characters. Generate with: openssl rand -base64 32 |
NEXT_PUBLIC_APP_URL |
Where users reach the app. Auth callbacks, email links and redirects are built from it, so production needs the public https URL. The scaffold sets http://localhost:3000. |
BETTER_AUTH_TRUSTED_ORIGINS |
Optional. More origins sign-in accepts besides NEXT_PUBLIC_APP_URL: a tunnel or a second port in development. Comma-separated, no spaces. A session belongs to the host it was made on, so sign in again on each. For example https://my-tunnel.example.dev,http://localhost:3001. |
INTELLIGO_BILLING_PRODUCT |
Which product’s plans the billing engine bills against. Your composition root also sets this via setDefaultProductSlug(); the variable is here so CLI tooling can check it without booting the app. The scaffold sets your-app. |
Optional — everything works locally without these
| Variable | What it is |
|---|---|
GOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRETGITHUB_CLIENT_IDGITHUB_CLIENT_SECRET |
Sign in with Google or GitHub. A provider’s button appears once both of its values are set; the callback URL to register with the provider is NEXT_PUBLIC_APP_URL + /api/auth/callback/google (or /github). |
OAUTH_PROVIDERSOAUTH_<ID>_CLIENT_IDOAUTH_<ID>_CLIENT_SECRETOAUTH_<ID>_AUTHORIZATION_URLOAUTH_<ID>_TOKEN_URLOAUTH_<ID>_USERINFO_URLOAUTH_<ID>_DISCOVERY_URLOAUTH_<ID>_SCOPESOAUTH_<ID>_NAME |
Any other OAuth 2.0 or OpenID Connect provider: list its id, then its OAUTH_<ID>_* values (better-auth 1.7 or later). Its button appears once they are complete; the callback URL is NEXT_PUBLIC_APP_URL + /api/auth/callback/<id>. DISCOVERY_URL replaces the three endpoint URLs for an OIDC provider. A provider whose profile lacks an email for some accounts needs a profile mapper (registerOAuthProfileMapper in the composition root). |
OAUTH_<ID>_SUBJECT_FIELD |
The profile field identifying the account when it is not id (plain OAuth) or sub (OpenID Connect), e.g. a plain provider answering sub. |
AUTH_IP_HEADERSAUTH_TRUSTED_PROXIES |
Behind proxies: the headers the auth rate limiter reads the client’s address from, in order (default x-forwarded-for), and the proxies’ CIDRs, so a forwarded chain is read up to the first hop not among them. Without them, an app behind more than one proxy counts every client as one. |
RESEND_API_KEY |
Email. Without a provider, emails (verification, invitations, reset links) are printed to the server console in development, and sign-ups are not held for email verification; production refuses to start unless EMAIL_PROVIDER=console. |
EMAIL_FROM |
The sender of every email, on a domain verified with Resend. Required with RESEND_API_KEY: there is no built-in sender, so sends fail without it. Loops ignores it and takes the sender from each template. For example Acme <noreply@example.com>. |
APP_NAMESUPPORT_EMAIL |
The product’s name in every email’s heading and footer; defaults to the display name in EMAIL_FROM. SUPPORT_EMAIL is the address the footer offers for replies; without it the footer offers none. For example Acme. |
LOOPS_API_KEY |
Loops sends by template id instead of HTML: map each template with LOOPS_TRANSACTIONAL_ID_<KEY>, e.g. LOOPS_TRANSACTIONAL_ID_VERIFY_EMAIL. |
EMAIL_PROVIDER |
With both keys set Resend wins; force one with resend | loops | console. For a provider of your own (SES, Postmark, SMTP), set custom and bind it in lib/intelligo.ts with setEmailProvider from @intelligo-dev/core/email. |
STRIPE_SECRET_KEYSTRIPE_WEBHOOK_SECRET |
Stripe. Billing pages say “not configured” until these are set; the webhook at /api/webhooks/stripe verifies with the secret. |
STORAGE_BUCKETSTORAGE_REGIONSTORAGE_ENDPOINTSTORAGE_ACCESS_KEY_IDSTORAGE_SECRET_ACCESS_KEY |
File storage for chat attachments in stored mode, on any S3-compatible bucket. Read by s3StorageFromEnv() once lib/intelligo.ts binds it with setStorageAdapter() (see @intelligo-dev/core’s README). The bucket and both keys go together; the region defaults to auto. |
PAYMENT_MODE |
Which registered payment provider serves payments outside Stripe (registerPaymentProvider in the composition root). Defaults to the in-memory mock, which production refuses. |
GOOGLE_GENERATIVE_AI_API_KEYOPENAI_API_KEYANTHROPIC_API_KEY |
AI providers. Chat answers from a built-in stub model until a key is set. With the chat page installed, GOOGLE_GENERATIVE_AI_API_KEY alone makes every turn run on Gemini (lib/chat-model.ts); the others are read once that file binds their provider. The provider’s SDK reads its key, and the framework checks none of them. |
INTELLIGO_ALLOW_STUB_MODEL |
The stub refuses to reply in a production build, so a deployment that never bound a model fails loudly. Set to 1 for one meant to run on it. |
CRON_SECRET |
Bearer token your scheduler sends to /api/cron/maintenance (intelligo add maintenance). At least 32 characters. |
LOG_LEVEL |
How much the server logs: fatal, error, warn, info, debug or trace. Defaults to info in production and debug elsewhere. |
LOG_FULL_IDS |
In production the log shortens every id. Set to 1 to write the ids of runs, requests, jobs and conversations whole, so a line can be looked up against its row. Ids of people and workspaces stay shortened. |
PLATFORM_ADMIN_EMAILS |
Comma-separated emails allowed to reach the Intelligo admin console. Closed by default: with no value, nobody is a platform admin. |
PLATFORM_ADMIN_REQUIRE_2FA |
Set to true to refuse the console to a platform admin who has not turned two-step sign-in on (Settings, Security). |
ACCOUNT_DELETION_GRACE_DAYS |
Days a deleted account can still be restored before it is purged (default 30). The restore screen and the purge both read it. |