Environment Variables
All CleverThis configuration is done via environment variables. This page is the complete reference.
Core (required)
| Variable | Description |
|---|---|
SECRET_KEY | 32-byte hex secret for signing tokens. Generate: openssl rand -hex 32 |
DATABASE_URL | PostgreSQL connection string: postgresql://user:pass@host:5432/db |
REDIS_URL | Redis connection string: redis://host:6379/0 |
NEXTAUTH_SECRET | 32-byte hex secret for NextAuth.js session signing |
NEXTAUTH_URL | Full URL of the webapp: https://app.example.com |
Email (required for account verification)
| Variable | Description |
|---|---|
SMTP_HOST | SMTP server hostname |
SMTP_PORT | SMTP port (587 for STARTTLS, 465 for SSL) |
SMTP_USER | SMTP username |
SMTP_PASSWORD | SMTP password |
SMTP_TLS | true or false. Default true. |
EMAIL_FROM | From address for outbound emails |
LLM Providers
| Variable | Description |
|---|---|
OPENAI_API_KEY | OpenAI API key |
ANTHROPIC_API_KEY | Anthropic API key |
GOOGLE_AI_API_KEY | Google AI (Gemini) API key |
MISTRAL_API_KEY | Mistral API key |
GROQ_API_KEY | Groq API key |
TOGETHER_API_KEY | Together 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)
| Variable | Description |
|---|---|
STRIPE_SECRET_KEY | Stripe secret key (sk_live_... or sk_test_...) |
STRIPE_PUBLISHABLE_KEY | Stripe publishable key (pk_live_... or pk_test_...) |
STRIPE_WEBHOOK_SECRET | Stripe webhook signing secret (whsec_...) |
Auth / OAuth (optional)
| Variable | Description |
|---|---|
GOOGLE_CLIENT_ID | Google OAuth client ID |
GOOGLE_CLIENT_SECRET | Google OAuth client secret |
GITHUB_CLIENT_ID | GitHub OAuth app client ID |
GITHUB_CLIENT_SECRET | GitHub OAuth app client secret |
Feature flags
| Variable | Default | Description |
|---|---|---|
INVITE_ONLY | false | Set true to require invite codes for registration |
ALLOW_SIGNUP | true | Set false to disable all new registrations |
TELEMETRY_ENABLED | true | OpenTelemetry trace export |
OTEL_EXPORTER_OTLP_ENDPOINT | — | OTLP collector endpoint |
Coming soon
A cleverthis config validate CLI command that checks all required env vars are set is being added.