# Sort out your environment variables

> Something is undefined in production and you’re not sure which keys go where.

Web page: https://buildladder.com/resources/prompts/env-var-inventory

What you get: One table of every variable, where it must be set and whether it’s safe for the browser, plus an up-to-date example .env file.

Paste it into: Your AI tool, in your project

## Prompt to copy

```text
Make an inventory of every environment variable this project reads: the app, its scripts, CI, and any serverless or edge functions. Include names read indirectly, for example through a helper or process.env[name].

For each one, give me: its name, the file and line that reads it, what it's for, whether it's required or optional, whether it's a secret or safe to show in the browser, whether it's needed when the project is built or only while it runs, and whether it needs a different value in each environment this project has. Flag any secret exposed to browser code through a public prefix such as NEXT_PUBLIC_ or VITE_, and any name in my .env files that no code reads.

Then find the project's example .env file, or create one if there's none, and make sure git isn't ignoring it. Give it every name with a placeholder, never a real value. Don't print values from any .env file.

Finish with where each variable has to be set (my host, the database provider, CI). Say so if you're unsure where a screen is.
```
