HCTHE HCLAB

Environment variables

Configure .env for local development.

Copy .env.example to .env and fill in values before running the app.

Required for local dev

Variable Purpose
DATABASE_URL PostgreSQL connection string
AUTH_SECRET Auth.js session signing secret (any long random string)

Strongly recommended

Variable Purpose
NEXT_PUBLIC_SITE_URL Canonical URL for SEO, emails, and redirects (http://localhost:3000 locally)
ADMIN_PASSWORD Password for seeded admin user lab@thehclab.com

Optional — enable as you need features

Variable Feature
RESEARCHER_PASSWORD Seeded researcher account (defaults to ADMIN_PASSWORD)
RESEND_API_KEY / EMAIL_FROM Password reset and welcome emails
MAILCHIMP_* Newsletter sync to Mailchimp
OPENAI_API_KEY AI-assisted study tasks
STRIPE_* Subscriptions and learning-path purchases
CRON_SECRET Secured background job endpoints
EXPORT_S3_* Large research export object storage
MAINTENANCE_MODE Site-wide maintenance page

See Usage & configuration → Environment variables for the full reference.

Auth.js note

In production on Vercel, set AUTH_TRUST_HOST=true. Locally this is usually unnecessary.

Security

Never commit .env to git. Use Vercel (or your host) environment settings for production secrets.