Enhance
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

VariableServiceDescription
DATABASE_URLAllPostgreSQL connection string
REDIS_URLWorkerRedis connection for BullMQ job queue

Example values:

DATABASE_URL="postgresql://prisma:prisma@localhost:5432/byggdrasil"
REDIS_URL="redis://localhost:6379"

Authentication

VariableServiceDescription
BETTER_AUTH_SECRETWebSession signing key. Generate with openssl rand -hex 32
BETTER_AUTH_URLWebAuth callback base URL (e.g., http://localhost:3000)

AI providers

VariableServiceDescription
OPENAI_API_KEYAllOpenAI API key for embeddings and LLM
OPENAI_EMBEDDING_MODELWorkerEmbedding model (default: text-embedding-3-small)
OPENAI_CHAT_MODELWorkerChat model (default: gpt-5-mini)
GEMINI_API_KEYAllGoogle Gemini API key (alternative to OpenAI)
GOOGLE_CHAT_MODELWorkerGoogle LLM model override

Internal communication

VariableServiceDescription
INTERNAL_API_SECRETWeb + WorkerShared secret between services. Must match in both. Generate with openssl rand -hex 32
ENCRYPTION_KEYWebEncryption key for stored API keys. Generate with openssl rand -hex 32

Public URLs

VariableServiceDescription
NEXT_PUBLIC_APP_URLWebFrontend base URL (default: http://localhost:3000)
NEXT_PUBLIC_REPO_WORKER_URLWebWorker API URL (default: http://localhost:3001)

Optional variables

GitHub integration

VariableDescription
GITHUB_CLIENT_IDGitHub OAuth app client ID
GITHUB_CLIENT_SECRETGitHub OAuth app secret
GITHUB_APP_IDGitHub App ID (for app-based repo access)
GITHUB_APP_PRIVATE_KEY_BASE64GitHub App private key (base64 encoded)
GITHUB_APP_WEBHOOK_SECRETWebhook signature secret
GITHUB_APP_SLUGGitHub App slug (for install links)

Linear integration

VariableDescription
LINEAR_CLIENT_IDLinear OAuth app client ID
LINEAR_CLIENT_SECRETLinear OAuth secret

Notion integration

VariableDescription
NOTION_CLIENT_IDNotion OAuth app client ID
NOTION_CLIENT_SECRETNotion OAuth secret

Azure DevOps integration

VariableDescription
AZURE_DEVOPS_CLIENT_IDAzure DevOps OAuth client ID
AZURE_DEVOPS_CLIENT_SECRETAzure DevOps OAuth secret

Email

VariableDescription
RESEND_API_KEYResend API key for sending emails (OTP, notifications)
SKIP_OTP_EMAILSet to true to skip sending OTP emails (dev mode)

Storage

VariableDescription
CLOUDFLARE_ACCOUNT_IDCloudflare account ID (for file uploads)
CLOUDFLARE_S3_APIS3-compatible API endpoint
CLOUDFLARE_R2_ACCESS_KEY_IDR2 access key
CLOUDFLARE_R2_SECRET_ACCESS_KEYR2 secret key

Worker configuration

VariableDefaultDescription
PORT3001Worker API port
HOST0.0.0.0Worker bind address
INDEXING_MODEsmartIndexing strategy: smart, shallow, deep, full
ENABLE_GIT_HISTORYtrueEnable git history analysis
PROGRESSIVE_EMBEDDINGStrueEmbed on-demand vs. upfront

Other

VariableDescription
TRIGGER_SECRET_KEYTrigger.dev API key
AGENT_URLAgent service URL (default: http://localhost:8787)
NODE_ENVdevelopment or production
MCP_DEV_MODEEnable 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.