Environment
Environment variables
Canonical template: .env.example at the monorepo root. Values below are grouped the same way; unset optional vars unless noted.
Database
Better Auth
Cross-app origins (Vite)
Used by appHref() / marketingHref() in packages/core (landing Sign in, Dashboard, pricing → app, etc.).
Documentation site (apps/docs)
Developer docs are a separate app in apps/docs (TanStack Start, default dev port 3002). Deploy it to https://docs.yourdomain.com (its own Vercel project or server build).
Local two-app setup (recommended)
With marketing on 3000 and the product app on 3001, set at least:
BETTER_AUTH_URL=http://localhost:3001BETTER_AUTH_TRUSTED_ORIGINS=http://localhost:3000,http://localhost:3001VITE_APP_ORIGIN=http://localhost:3001VITE_MARKETING_ORIGIN=http://localhost:3000
Copy from .env.example at the repo root. Restart dev servers after changes (Vite reads VITE_* at startup).
Use the same host you put in the URL (localhost vs 127.0.0.1) everywhere; they are different origins for cookies and Better Auth.
Transactional email (Resend)
OAuth (optional)
Set both client id and secret per provider. Callback URLs:
{BETTER_AUTH_URL}/api/auth/callback/google{BETTER_AUTH_URL}/api/auth/callback/github
Marketing / SEO (Vite)
Platform admin
Stripe
See Stripe & billing for checkout, webhooks, and local testing.
Seeding (optional)
See Database seeding.