.env.local for local dev or in the Vercel project settings for deployment.
Required
Database
The platform expects to authenticate through the Cloud SQL Connector. Direct DB password connections are not supported.
Optional (with defaults)
Table names
The platform supports running against differently-named tables — useful for multi-tenant or staging setups.Pricing
Example .env.local
Generating the service account base64
.env.local. The platform decodes it at startup and uses it to authenticate with Cloud SQL.
How vars are loaded
- Local: Next.js auto-loads
.env,.env.local,.env.development.localfrom the repo root - Vercel: Set them in Project → Settings → Environment Variables. Use the Vercel CLI’s
vercel env pullto mirror them locally.
Security notes
- The service account JSON is decoded into
/tmpat startup, then deleted after the connector reads it. The file mode is0o600. - No env var is exposed to the client — every secret-bearing read happens server-side.
- CSP headers in
next.config.tsfurther restrict where the app can be framed from.