Environment variables
The environment variables that configure the platform, grouped by concern.
Environment is configured through .env / .env.local at the repo root. Copy
.env.local.example to start. The example ships with local-development defaults that already match
the Docker services, so most variables can be left as-is for local work.
Variables prefixed with NEXT_PUBLIC_ are exposed to the browser. Everything else is
server-only.
Core
| Variable | Purpose | Required |
|---|---|---|
DATABASE_URL | PostgreSQL connection string. Local default points at the Docker Postgres on :6432. | Yes |
BETTER_AUTH_SECRET | Secret used to sign and encrypt auth sessions. Use a long random string. | Yes |
NEXT_PUBLIC_SAAS_URL | Absolute URL of the product app. Used for auth callbacks and links. | Yes |
NEXT_PUBLIC_MARKETING_URL | Absolute URL of the marketing site. | Yes |
NEXT_PUBLIC_DOCS_URL | Absolute URL of this docs site. | Yes |
AI providers
The platform resolves embedding and chat models through these settings. OpenRouter is the default gateway; Ollama is an optional development-only path.
| Variable | Purpose | Required |
|---|---|---|
OPENROUTER_API_KEY | API key for the OpenRouter gateway (chat + embeddings). | Yes for live AI |
OPENROUTER_SITE_URL, OPENROUTER_APP_NAME | Attribution headers sent to OpenRouter. | No |
EMBEDDING_PROVIDER | openrouter (default) or ollama. | No |
EMBEDDING_MODEL | Override the embedding model id. | No |
EMBEDDING_DIMENSIONS | Embedding vector size. Must match the database vector column (default 1536). | No |
OLLAMA_BASE_URL, OLLAMA_CHAT_MODEL, OLLAMA_API_KEY | Local Ollama endpoint and model (development only; ignored when NODE_ENV=production). | No |
Changing EMBEDDING_DIMENSIONS after documents are indexed requires a schema migration and a full
re-embedding of the corpus, because the stored vectors and the query vectors must have the same
dimension. See The knowledge ingestion pipeline.
Storage
Uploaded knowledge and policy documents are stored in S3-compatible object storage (MinIO locally).
| Variable | Purpose | Required |
|---|---|---|
S3_ENDPOINT | S3 endpoint URL. Local default is the Docker MinIO on :9000. | Yes |
S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY | Storage credentials (minioadmin / minioadmin locally). | Yes |
S3_REGION | Region name (auto works for MinIO). | No |
NEXT_PUBLIC_POLICIES_BUCKET_NAME | Bucket for fund policy documents. | No |
NEXT_PUBLIC_AVATARS_BUCKET_NAME | Bucket for user/organization avatars. | No |
Mail, payments, and analytics
These integrations are optional for local development and can be left blank.
| Group | Variables | Notes |
|---|---|---|
MAIL_FROM, MAIL_HOST, MAIL_PORT, MAIL_USER, MAIL_PASS, and provider keys (RESEND_API_KEY, PLUNK_API_KEY, etc.) | Transactional email. Unset = email sending is a no-op locally. | |
| Payments | Provider keys and PRICE_ID_* values | The payment provider and price IDs are configured via environment. Leave blank locally; plan tiers still function without a live provider. |
| Analytics / monitoring | SENTRY_DSN, NEXT_PUBLIC_SENTRY_DSN, and analytics keys | All no-ops when unset. |
For the exact list of supported keys, refer to .env.local.example, which is the source of truth.