Skip to content
EANVI

Environment variables best practices

Clear naming, documented examples, strict gitignore rules, and per-environment isolation keep environment configuration maintainable as teams grow.

Use consistent, SCREAMING_SNAKE names

Prefer DATABASE_URL over databaseUrl in env. Consistency makes shell, Docker, and CI configuration predictable.

Commit .env.example, never real secrets

Document required keys with placeholder values. Real secrets belong in EANVI (or another vault), not in git.

DATABASE_URL=postgresql://user:password@localhost:5432/app
API_KEY=your_api_key_here
NODE_ENV=development

Isolate environments deliberately

Keep separate values for development, staging, and production. Copy structure, not live credentials, when bootstrapping a new environment.

Fail fast on missing required variables

Validate required env at startup. Silent undefined values cause confusing runtime failures later.

Related resources

Try EANVI

Create a workspace, import a .env, and pull secrets from the CLI.