Environment Variables
All environment variables required and optional for running Technical Debt Radar.
Environment Variables
Complete list of environment variables used by Technical Debt Radar's API server, workers, and CLI.
Core
| Variable | Required | Description | Example |
|---|---|---|---|
NODE_ENV | Yes | Runtime environment | production, development, test |
APP_URL | Yes | Frontend application URL | https://app.radar.dev |
API_URL | Yes | API server URL | https://api.radar.dev |
Database
| Variable | Required | Description | Example |
|---|---|---|---|
DATABASE_URL | Yes | PostgreSQL connection string | postgresql://user:pass@localhost:5432/radar?schema=public |
The connection string is used by Prisma. It supports all standard PostgreSQL connection parameters:
postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=SCHEMA&connection_limit=5
For production, include connection_limit to control the Prisma connection pool size. Default is 5 connections.
Redis
| Variable | Required | Description | Example |
|---|---|---|---|
REDIS_URL | Yes | Redis connection string for BullMQ | redis://localhost:6379 |
Redis is used for the BullMQ job queue (PR analysis, background processing). For production, use a dedicated Redis instance or Redis cluster.
redis://:PASSWORD@HOST:PORT/DB_NUMBER
Authentication
| Variable | Required | Description | Example |
|---|---|---|---|
JWT_SECRET | Yes | Secret key for signing JWT access tokens | your-256-bit-secret-key |
JWT_EXPIRY | No | Access token expiration time | 15m (default) |
REFRESH_TOKEN_EXPIRY | No | Refresh token expiration time | 7d (default) |
Generate a strong JWT secret:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
GitHub Integration
GitHub App
| Variable | Required | Description | Example |
|---|---|---|---|
GITHUB_APP_ID | Yes* | GitHub App ID | 123456 |
GITHUB_PRIVATE_KEY | Yes* | GitHub App private key (PEM format) | -----BEGIN RSA PRIVATE KEY-----\n... |
GITHUB_WEBHOOK_SECRET | Yes* | Webhook signature verification secret | whsec_abc123... |
*Required when using the GitHub App integration for PR analysis.
The private key can be provided as a file path or inline with \n for newlines:
# File path
GITHUB_PRIVATE_KEY="$(cat ./github-app-private-key.pem)"
# Inline (replace newlines with \n)
GITHUB_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\nMIIE..."
GitHub OAuth
| Variable | Required | Description | Example |
|---|---|---|---|
GITHUB_CLIENT_ID | Yes* | OAuth App client ID | Iv1.abc123def456 |
GITHUB_CLIENT_SECRET | Yes* | OAuth App client secret | ghs_abc123... |
*Required when enabling GitHub OAuth login.
Google OAuth
| Variable | Required | Description | Example |
|---|---|---|---|
GOOGLE_CLIENT_ID | Yes* | Google OAuth client ID | 123456.apps.googleusercontent.com |
GOOGLE_CLIENT_SECRET | Yes* | Google OAuth client secret | GOCSPX-abc123... |
*Required when enabling Google OAuth login. Configure the OAuth consent screen and authorized redirect URIs in the Google Cloud Console.
Stripe (Billing)
| Variable | Required | Description | Example |
|---|---|---|---|
STRIPE_SECRET_KEY | Yes* | Stripe API secret key | sk_live_abc123... |
STRIPE_WEBHOOK_SECRET | Yes* | Stripe webhook signing secret | whsec_abc123... |
*Required when enabling Stripe billing.
Use sk_test_... and whsec_test_... keys for development. Set up the webhook endpoint in the Stripe Dashboard pointing to https://api.radar.dev/v1/billing/webhook/stripe.
PayPal (Billing)
| Variable | Required | Description | Example |
|---|---|---|---|
PAYPAL_CLIENT_ID | Yes* | PayPal REST API client ID | AaBbCc123... |
PAYPAL_CLIENT_SECRET | Yes* | PayPal REST API client secret | EeFfGg456... |
PAYPAL_WEBHOOK_ID | Yes* | PayPal webhook ID for signature verification | WH-abc123... |
*Required when enabling PayPal billing.
For development, use PayPal Sandbox credentials. Set the webhook URL to https://api.radar.dev/v1/billing/webhook/paypal.
AI (Anthropic)
| Variable | Required | Description | Example |
|---|---|---|---|
ANTHROPIC_API_KEY | Yes* | Anthropic API key for Claude | sk-ant-api03-abc123... |
*Required when enabling AI-powered features (scan summaries, cross-file analysis, fix suggestions).
The API key is used server-side only. AI analysis uses Claude Sonnet for cost-effective, high-quality code analysis.
CLI
| Variable | Required | Description | Example |
|---|---|---|---|
RADAR_API_KEY | Yes* | API key for CLI authentication | rdr_abc123... |
*Required when using the CLI tool to interact with the Radar API. Generate an API key from the dashboard settings.
The CLI also respects these optional variables:
# Override the API endpoint (for self-hosted)
RADAR_API_URL=https://radar.internal.company.com/v1
# Enable verbose output
RADAR_VERBOSE=true
Complete .env Template
# ── Core ─────────────────────────────────────────
NODE_ENV=development
APP_URL=http://localhost:3000
API_URL=http://localhost:3001
# ── Database ─────────────────────────────────────
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/radar?schema=public
# ── Redis ────────────────────────────────────────
REDIS_URL=redis://localhost:6379
# ── Auth ─────────────────────────────────────────
JWT_SECRET=change-me-to-a-random-256-bit-hex-string
JWT_EXPIRY=15m
REFRESH_TOKEN_EXPIRY=7d
# ── GitHub App ───────────────────────────────────
GITHUB_APP_ID=
GITHUB_PRIVATE_KEY=
GITHUB_WEBHOOK_SECRET=
# ── GitHub OAuth ─────────────────────────────────
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
# ── Google OAuth ─────────────────────────────────
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
# ── Stripe ───────────────────────────────────────
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
# ── PayPal ───────────────────────────────────────
PAYPAL_CLIENT_ID=
PAYPAL_CLIENT_SECRET=
PAYPAL_WEBHOOK_ID=
# ── AI ───────────────────────────────────────────
ANTHROPIC_API_KEY=
# ── CLI ──────────────────────────────────────────
RADAR_API_KEY=
Security Notes
- Never commit
.envfiles to version control. Add.envto.gitignore. - Use different secrets per environment. Development, staging, and production should each have unique JWT secrets and API keys.
- Rotate secrets regularly. Especially
JWT_SECRET,GITHUB_PRIVATE_KEY, and payment provider keys. - Use a secrets manager in production. AWS Secrets Manager, HashiCorp Vault, or your cloud provider's equivalent.
- Restrict API key permissions. GitHub App permissions should be minimal: read access to code, write access to pull requests and commit statuses.