GudCalGudCal
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

VariableDescription
DATABASE_URLPostgreSQL connection string
AUTH_SECRETRandom secret for encrypting sessions (generate with npx auth secret)
NEXT_PUBLIC_APP_URLYour deployment URL, e.g. https://cal.example.com

Authentication

VariableDescription
GOOGLE_CLIENT_IDGoogle OAuth client ID for login
GOOGLE_CLIENT_SECRETGoogle OAuth client secret for login

Google Calendar

VariableDescription
GOOGLE_CALENDAR_CLIENT_IDOAuth client ID for calendar sync (can differ from login)
GOOGLE_CALENDAR_CLIENT_SECRETOAuth client secret for calendar sync
ENCRYPTION_KEY32-byte hex key for encrypting stored OAuth tokens

Generate with:

node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

Email

VariableDescription
RESEND_API_KEYAPI key from Resend for transactional emails

Billing (Optional)

VariableDescription
STRIPE_API_KEYStripe secret key
STRIPE_WEBHOOK_SECRETStripe webhook signing secret
NEXT_PUBLIC_STRIPE_PRO_MONTHLY_PLAN_IDPrice ID for Pro monthly plan
NEXT_PUBLIC_STRIPE_PRO_YEARLY_PLAN_IDPrice ID for Pro yearly plan
NEXT_PUBLIC_STRIPE_TEAM_MONTHLY_PLAN_IDPrice ID for Team monthly plan
NEXT_PUBLIC_STRIPE_TEAM_YEARLY_PLAN_IDPrice 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

VariableDescription
CRON_SECRETSecret for authenticating the reminder cron endpoint
NEXT_PUBLIC_IS_SELF_HOSTEDSet 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"