.env.local file for local development and in your Vercel project settings for production.
Required Variables
These environment variables are required for DelightBridge to function properly.ANTHROPIC_API_KEY
Purpose: Authenticates requests to Anthropic’s Claude API for AI-powered draft generation, translation, and refinement. Format:sk-ant-...
Where to get it:
- Sign up or log in at console.anthropic.com
- Navigate to API Keys section
- Create a new API key
- Copy the key (it starts with
sk-ant-)
DATABASE_URL
Purpose: PostgreSQL connection string for Neon DB. Used by Drizzle ORM to connect to your database. Format:postgresql://[user]:[password]@[endpoint].neon.tech/[database]?sslmode=require
Where to get it:
- Create a Neon project at neon.tech
- Copy the connection string from the project dashboard
- Ensure it includes
?sslmode=requireat the end
The DATABASE_URL is used by both the application runtime and Drizzle CLI commands (
pnpm db:push, pnpm db:seed).GOOGLE_CLIENT_ID
Purpose: OAuth 2.0 client ID for Google authentication. Used for both:- App user authentication (NextAuth)
- Service Gmail connection (Gmail API access)
[random-string].apps.googleusercontent.com
Where to get it: See OAuth Setup for detailed instructions.
Example:
GOOGLE_CLIENT_SECRET
Purpose: OAuth 2.0 client secret that pairs withGOOGLE_CLIENT_ID.
Format: Random alphanumeric string
Where to get it: See OAuth Setup for detailed instructions.
Example:
AUTH_SECRET
Purpose: Secret key used by NextAuth to encrypt session tokens and cookies. Format: Random string (minimum 32 characters recommended) How to generate:Use different
AUTH_SECRET values for development and production environments.ADMIN_EMAILS
Purpose: Comma-separated list of email addresses that should have admin access to DelightBridge. Admin users can:- Manage services and Gmail connections
- Access all workspace features
- Manage workspace members and permissions
- Trigger manual syncs
Users listed in
ADMIN_EMAILS automatically receive admin permission, even if they’re also in the workspace_members table with a lower permission level.CRON_SECRET
Purpose: Authentication token for protecting the Gmail sync cron endpoint. Vercel cron jobs send this secret to verify they’re authorized to trigger syncs. Format: Random string How to generate:/api/cron/sync-gmail checks for this secret in:
Authorization: Bearer <CRON_SECRET>header, ORx-cron-secret: <CRON_SECRET>header
Optional Variables
These variables have default values but can be customized.CRON_SYNC_MAX_ACCOUNTS
Purpose: Maximum number of Gmail accounts to sync per cron run (every 5 minutes). Prevents timeouts and API rate limit issues when managing many services. Default:20
Format: Positive integer
Example:
For most deployments, the default value of 20 is sufficient. Only increase if you have faster infrastructure and higher Gmail API quotas.
Environment File Examples
Local Development (.env.local)
Production (Vercel)
In your Vercel project settings, add the same variables with production values:- Use a different
AUTH_SECRETfor production - Use the production Neon database connection string
- Ensure
CRON_SECRETmatches between environment variables and cron headers - Update
ADMIN_EMAILSwith production admin email addresses
Validation Checklist
Before running DelightBridge, verify:- All required variables are set
-
DATABASE_URLincludes?sslmode=require -
GOOGLE_CLIENT_IDends with.apps.googleusercontent.com -
AUTH_SECRETis at least 32 characters -
ADMIN_EMAILScontains valid email addresses -
CRON_SECRETis set to a secure random string - OAuth redirect URIs are configured in Google Cloud Console
Common Issues
”Invalid connection string” error
EnsureDATABASE_URL ends with ?sslmode=require for Neon DB.
”Unauthorized” when accessing the app
Verify your email is inADMIN_EMAILS or added to workspace members via Settings.
Cron sync fails with 401
Check thatCRON_SECRET is set in Vercel environment variables and matches the value expected by the endpoint.
Gmail API quota exceeded
ReduceCRON_SYNC_MAX_ACCOUNTS or increase the cron interval in vercel.json.