Docs
Environment Variables
Environment Variables
Complete reference for all GudCal environment variables.
GudCal is configured entirely through environment variables. Below is a complete reference.
Required
| Variable | Description |
|---|---|
DATABASE_URL | PostgreSQL connection string |
AUTH_SECRET | Random secret for encrypting sessions (generate with npx auth secret) |
NEXT_PUBLIC_APP_URL | Your deployment URL, e.g. https://cal.example.com |
Authentication
| Variable | Description |
|---|---|
GOOGLE_CLIENT_ID | Google OAuth client ID for login |
GOOGLE_CLIENT_SECRET | Google OAuth client secret for login |
Google Calendar
| Variable | Description |
|---|---|
GOOGLE_CALENDAR_CLIENT_ID | OAuth client ID for calendar sync (can differ from login) |
GOOGLE_CALENDAR_CLIENT_SECRET | OAuth client secret for calendar sync |
ENCRYPTION_KEY | 32-byte hex key for encrypting stored OAuth tokens |
Generate with:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"| Variable | Description |
|---|---|
RESEND_API_KEY | API key from Resend for transactional emails |
Billing (Optional)
| Variable | Description |
|---|---|
STRIPE_API_KEY | Stripe secret key |
STRIPE_WEBHOOK_SECRET | Stripe webhook signing secret |
NEXT_PUBLIC_STRIPE_PRO_MONTHLY_PLAN_ID | Price ID for Pro monthly plan |
NEXT_PUBLIC_STRIPE_PRO_YEARLY_PLAN_ID | Price ID for Pro yearly plan |
NEXT_PUBLIC_STRIPE_TEAM_MONTHLY_PLAN_ID | Price ID for Team monthly plan |
NEXT_PUBLIC_STRIPE_TEAM_YEARLY_PLAN_ID | Price ID for Team yearly plan |
Stripe variables are only needed if you're running GudCal as a SaaS with paid plans. Self-hosted deployments can ignore these — all features are unlocked by default.
Cron & Misc
| Variable | Description |
|---|---|
CRON_SECRET | Secret for authenticating the reminder cron endpoint |
NEXT_PUBLIC_IS_SELF_HOSTED | Set to true to enable self-hosted mode |
Example .env.local
# Database
DATABASE_URL="postgresql://user:pass@host:5432/gudcal"
# Auth
AUTH_SECRET="generate-with-npx-auth-secret"
NEXT_PUBLIC_APP_URL="http://localhost:3000"
GOOGLE_CLIENT_ID="xxx.apps.googleusercontent.com"
GOOGLE_CLIENT_SECRET="xxx"
# Google Calendar (optional)
GOOGLE_CALENDAR_CLIENT_ID="xxx.apps.googleusercontent.com"
GOOGLE_CALENDAR_CLIENT_SECRET="xxx"
ENCRYPTION_KEY="64-char-hex-string"
# Email (optional)
RESEND_API_KEY="re_xxx"
# Cron (optional)
CRON_SECRET="a-random-secret"