Reference
Environment Variables
Complete configuration reference for all Enhance services.
Enhance uses environment variables for configuration. Variables are split across three services: the web app, the repo worker, and the Prisma package.
Required variables
Database and cache
| Variable | Service | Description |
|---|
DATABASE_URL | All | PostgreSQL connection string |
REDIS_URL | Worker | Redis connection for BullMQ job queue |
Example values:
DATABASE_URL="postgresql://prisma:prisma@localhost:5432/byggdrasil"
REDIS_URL="redis://localhost:6379"
Authentication
| Variable | Service | Description |
|---|
BETTER_AUTH_SECRET | Web | Session signing key. Generate with openssl rand -hex 32 |
BETTER_AUTH_URL | Web | Auth callback base URL (e.g., http://localhost:3000) |
AI providers
| Variable | Service | Description |
|---|
OPENAI_API_KEY | All | OpenAI API key for embeddings and LLM |
OPENAI_EMBEDDING_MODEL | Worker | Embedding model (default: text-embedding-3-small) |
OPENAI_CHAT_MODEL | Worker | Chat model (default: gpt-5-mini) |
GEMINI_API_KEY | All | Google Gemini API key (alternative to OpenAI) |
GOOGLE_CHAT_MODEL | Worker | Google LLM model override |
Internal communication
| Variable | Service | Description |
|---|
INTERNAL_API_SECRET | Web + Worker | Shared secret between services. Must match in both. Generate with openssl rand -hex 32 |
ENCRYPTION_KEY | Web | Encryption key for stored API keys. Generate with openssl rand -hex 32 |
Public URLs
| Variable | Service | Description |
|---|
NEXT_PUBLIC_APP_URL | Web | Frontend base URL (default: http://localhost:3000) |
NEXT_PUBLIC_REPO_WORKER_URL | Web | Worker API URL (default: http://localhost:3001) |
Optional variables
GitHub integration
| Variable | Description |
|---|
GITHUB_CLIENT_ID | GitHub OAuth app client ID |
GITHUB_CLIENT_SECRET | GitHub OAuth app secret |
GITHUB_APP_ID | GitHub App ID (for app-based repo access) |
GITHUB_APP_PRIVATE_KEY_BASE64 | GitHub App private key (base64 encoded) |
GITHUB_APP_WEBHOOK_SECRET | Webhook signature secret |
GITHUB_APP_SLUG | GitHub App slug (for install links) |
Linear integration
| Variable | Description |
|---|
LINEAR_CLIENT_ID | Linear OAuth app client ID |
LINEAR_CLIENT_SECRET | Linear OAuth secret |
Notion integration
| Variable | Description |
|---|
NOTION_CLIENT_ID | Notion OAuth app client ID |
NOTION_CLIENT_SECRET | Notion OAuth secret |
Azure DevOps integration
| Variable | Description |
|---|
AZURE_DEVOPS_CLIENT_ID | Azure DevOps OAuth client ID |
AZURE_DEVOPS_CLIENT_SECRET | Azure DevOps OAuth secret |
Email
| Variable | Description |
|---|
RESEND_API_KEY | Resend API key for sending emails (OTP, notifications) |
SKIP_OTP_EMAIL | Set to true to skip sending OTP emails (dev mode) |
Storage
| Variable | Description |
|---|
CLOUDFLARE_ACCOUNT_ID | Cloudflare account ID (for file uploads) |
CLOUDFLARE_S3_API | S3-compatible API endpoint |
CLOUDFLARE_R2_ACCESS_KEY_ID | R2 access key |
CLOUDFLARE_R2_SECRET_ACCESS_KEY | R2 secret key |
Worker configuration
| Variable | Default | Description |
|---|
PORT | 3001 | Worker API port |
HOST | 0.0.0.0 | Worker bind address |
INDEXING_MODE | smart | Indexing strategy: smart, shallow, deep, full |
ENABLE_GIT_HISTORY | true | Enable git history analysis |
PROGRESSIVE_EMBEDDINGS | true | Embed on-demand vs. upfront |
Other
| Variable | Description |
|---|
TRIGGER_SECRET_KEY | Trigger.dev API key |
AGENT_URL | Agent service URL (default: http://localhost:8787) |
NODE_ENV | development or production |
MCP_DEV_MODE | Enable MCP dev mode (skips auth) |
Environment file locations
apps/web/.env # Web app
apps/repo-worker/.env # Repo worker
packages/prisma/.env # Database (DATABASE_URL only)
packages/trigger/.env # Trigger.dev (optional)
Copy .env.example files as a starting template for each service.