What are environment variables?
A named value that lives outside your code, in the environment the program runs in.
Your app needs a database password and an API key. Writing them straight into your code is one of the most common security mistakes there is.
What it is
An environment variable is a named value that lives outside your code, in the environment the program runs in.
How it works
Your code asks for a name, like DATABASE_URL, and the system hands it the value. On your laptop, the values might come from a .env file that never gets committed. In production, the hosting platform sets them. Same code, different values in each place.
Why it matters
Secrets stay out of Git, and you can point the same app at a test database or the real one without changing a line.










