Configuration
All environment variables and how to configure the template for your SaaS.
Environment Variables
Create a .env file (copy from .env.example) and set these values:
Required
| Variable | Description | How to get it |
|---|---|---|
AUTH_SECRET | JWT signing secret | openssl rand -base64 32 |
POSTGRES_URL | PostgreSQL connection string | Neon, Supabase, or Vercel Postgres dashboard |
STRIPE_SECRET_KEY | Stripe secret key | Stripe Dashboard → Developers → API keys |
STRIPE_WEBHOOK_SECRET | Stripe webhook signing key | Stripe Dashboard → Webhooks → Add endpoint |
Optional (OAuth)
| Variable | Description |
|---|---|
GOOGLE_CLIENT_ID | Google OAuth client ID |
GOOGLE_CLIENT_SECRET | Google OAuth client secret |
GITHUB_CLIENT_ID | GitHub OAuth client ID |
GITHUB_CLIENT_SECRET | GitHub OAuth client secret |
Stripe Setup
- Create a Stripe account
- Create products and prices in Stripe Dashboard
- Set
STRIPE_SECRET_KEYto your secret key (sk_test_...) - Create a webhook endpoint pointing to
https://your-domain.com/api/stripe/webhook - Set
STRIPE_WEBHOOK_SECRETto the webhook signing secret
Test Mode
Use Stripe test mode (sk_test_...) while developing. Test card: 4242 4242 4242 4242 with any future expiration and CVC.
Database Setup
- Create a PostgreSQL database (we recommend Neon)
- Copy the connection string to
POSTGRES_URL - Run migrations:
npx drizzle-kit migrate
The schema includes tables for users, teams, team members, invitations, activities, and Stripe subscriptions.
Next: Deployment →