Skip to main content

Environment Variables

All CleverThis configuration is done via environment variables. This page is the complete reference.

Core (required)

VariableDescription
SECRET_KEY32-byte hex secret for signing tokens. Generate: openssl rand -hex 32
DATABASE_URLPostgreSQL connection string: postgresql://user:pass@host:5432/db
REDIS_URLRedis connection string: redis://host:6379/0
NEXTAUTH_SECRET32-byte hex secret for NextAuth.js session signing
NEXTAUTH_URLFull URL of the webapp: https://app.example.com

Email (required for account verification)

VariableDescription
SMTP_HOSTSMTP server hostname
SMTP_PORTSMTP port (587 for STARTTLS, 465 for SSL)
SMTP_USERSMTP username
SMTP_PASSWORDSMTP password
SMTP_TLStrue or false. Default true.
EMAIL_FROMFrom address for outbound emails

LLM Providers

VariableDescription
OPENAI_API_KEYOpenAI API key
ANTHROPIC_API_KEYAnthropic API key
GOOGLE_AI_API_KEYGoogle AI (Gemini) API key
MISTRAL_API_KEYMistral API key
GROQ_API_KEYGroq API key
TOGETHER_API_KEYTogether AI API key

At least one provider key is required. You can also configure providers via the management API at runtime.

Stripe (required for billing)

VariableDescription
STRIPE_SECRET_KEYStripe secret key (sk_live_... or sk_test_...)
STRIPE_PUBLISHABLE_KEYStripe publishable key (pk_live_... or pk_test_...)
STRIPE_WEBHOOK_SECRETStripe webhook signing secret (whsec_...)

Auth / OAuth (optional)

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

Feature flags

VariableDefaultDescription
INVITE_ONLYfalseSet true to require invite codes for registration
ALLOW_SIGNUPtrueSet false to disable all new registrations
TELEMETRY_ENABLEDtrueOpenTelemetry trace export
OTEL_EXPORTER_OTLP_ENDPOINTOTLP collector endpoint
Coming soon

A cleverthis config validate CLI command that checks all required env vars are set is being added.