📖 Step 6: Development#169 / 291

Environment Variable

Environment Variable

📖One-line summary

Sensitive config like API keys, managed in a .env file.

💡Easy explanation

A way to store secrets like API keys and passwords outside your code in a separate file (.env). Like a secret vault.

Example

Manage sensitive config via the .env file

# .env

DATABASE_URL=postgresql://db:****

API_KEY=sk-****

NODE_ENV=production

process.env.API_KEYsk-****

Vibe coding prompt examples

>_

Configure DB credentials, API keys, and the JWT secret in a .env file, and set up type-safe loading in TypeScript.

>_

Build a structure that separates env vars across development, staging, and production. Organize .env.local and .env.production files.

Try these prompts in your AI coding assistant!