Cadense

Environment Variables

Configuration reference for Cadense

Required

VariableDescription
DATABASE_URLPostgreSQL connection string
BETTER_AUTH_SECRETAuth secret (32 hex chars): openssl rand -hex 32
BETTER_AUTH_URLYour app URL
ENCRYPTION_KEYEncryption key (32 hex chars): openssl rand -hex 32
INTERNAL_API_SECRETInternal API secret (32 hex chars): openssl rand -hex 32
NEXT_PUBLIC_APP_URLPublic app URL
NEXT_PUBLIC_SOCKET_URLWebSocket URL (default: http://localhost:3002)

AI Providers

VariableProvider
OPENAI_API_KEYOpenAI
ANTHROPIC_API_KEY_1Anthropic Claude
GEMINI_API_KEY_1Google Gemini
MISTRAL_API_KEYMistral
OLLAMA_URLOllama (default: http://localhost:11434)

For load balancing, add multiple keys with _1, _2, _3 suffixes (e.g., OPENAI_API_KEY_1, OPENAI_API_KEY_2). Works with OpenAI, Anthropic, and Gemini.

In Docker, use OLLAMA_URL=http://host.docker.internal:11434 for host-machine Ollama.

Azure OpenAI

VariableDescription
AZURE_OPENAI_API_KEYAzure OpenAI API key
AZURE_OPENAI_ENDPOINTAzure OpenAI endpoint URL
AZURE_OPENAI_API_VERSIONAPI version (e.g., 2024-02-15-preview)

vLLM (Self-Hosted)

VariableDescription
VLLM_BASE_URLvLLM server URL (e.g., http://localhost:8000/v1)
VLLM_API_KEYOptional bearer token for vLLM

OAuth Providers

VariableDescription
GOOGLE_CLIENT_IDGoogle OAuth client ID
GOOGLE_CLIENT_SECRETGoogle OAuth client secret
GITHUB_CLIENT_IDGitHub OAuth client ID
GITHUB_CLIENT_SECRETGitHub OAuth client secret

Social Login (identity-only)

Login providers authenticate a user into Cadense and use identity-only scopes. They are separate from integration OAuth (which authorizes workflows to call third-party services). A provider appears in the login UI only when both its client id and secret are set and it is not disabled. Preferred AUTH_* credentials fall back to the shared integration credentials during migration.

VariableDescription
AUTH_GOOGLE_CLIENT_ID / AUTH_GOOGLE_CLIENT_SECRETGoogle login credentials (fall back to GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET)
AUTH_GITHUB_CLIENT_ID / AUTH_GITHUB_CLIENT_SECRETGitHub login credentials (fall back to GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRET)
AUTH_MICROSOFT_CLIENT_ID / AUTH_MICROSOFT_CLIENT_SECRETMicrosoft login credentials (fall back to MICROSOFT_CLIENT_ID / MICROSOFT_CLIENT_SECRET)
AUTH_MICROSOFT_TENANTEntra tenant: organizations (default) | common | consumers | <tenant-id>; falls back to MICROSOFT_TENANT_ID
DISABLE_GOOGLE_AUTH / DISABLE_GITHUB_AUTH / DISABLE_MICROSOFT_AUTHSet to true to hide a provider even when its credentials are set

Register each provider's redirect URI as ${BETTER_AUTH_URL}/api/auth/callback/<provider>. Provider readiness is queryable at GET /api/auth/providers and is logged at startup. See the deployment runbook at docs/deployment/auth-provider-expansion.md for details.

Optional

VariableDescription
API_ENCRYPTION_KEYEncrypts stored API keys (32 hex chars): openssl rand -hex 32
COPILOT_API_KEYAPI key for copilot features
ADMIN_API_KEYAdmin API key for GitOps operations
RESEND_API_KEYEmail service for notifications
ALLOWED_LOGIN_DOMAINSRestrict signups to domains (comma-separated)
ALLOWED_LOGIN_EMAILSRestrict signups to specific emails (comma-separated)
DISABLE_REGISTRATIONSet to true to disable new user signups

Example .env

DATABASE_URL=postgresql://postgres:postgres@db:5432/billflowap
BETTER_AUTH_SECRET=<openssl rand -hex 32>
BETTER_AUTH_URL=https://billflowap.yourdomain.com
ENCRYPTION_KEY=<openssl rand -hex 32>
INTERNAL_API_SECRET=<openssl rand -hex 32>
NEXT_PUBLIC_APP_URL=https://billflowap.yourdomain.com
NEXT_PUBLIC_SOCKET_URL=https://billflowap.yourdomain.com
OPENAI_API_KEY=sk-...

See apps/cadense/.env.example for all options.

On this page

On this page