Skip to content
d3 Wiki
02.04

Environment variables and config management

Config is explicit, per environment, and never committed.

Updated
Oct 3, 2026
On this page

Purpose

Config is explicit, per environment, and never committed.

The standard

  • .env.example is committed and lists every variable with a placeholder and a one-line comment. .env.local is gitignored.

  • Browser-exposed values are prefixed NEXT_PUBLIC_ and are never secrets.

  • Production values live only in the hosting provider (Vercel) or the secret manager (07.01) — not in chat, docs, or repos.

  • Validate env at startup with a schema (zod) so a missing variable fails loudly at boot, not at 2 a.m.

  • Feature flags are env-driven for now (FEATURE_X=true); revisit if we exceed ~10.

Procedure — adding a variable

  1. Add to .env.example with comment. 2. Add to the env schema. 3. Add to Vercel for preview and production. 4. Note it in the PR description.

Owner: Matt · Last reviewed: 2026-09