What is an environment variable?
An environment variable is a named setting stored outside your code, such as an API key or a database address. Your app reads it when it runs, so secrets stay out of your shared files.
An example
You save MAPS_KEY=abc123 in your .env file, which Git ignores. Your code asks for MAPS_KEY by name, so the real key never reaches GitHub.
Where you’ll meet it
- Get an honest review · Build a web app
- Save and load data in your app · Save data with Supabase
- Add sign-up and sign-in pages · Add sign-in with Supabase
- Save and load data in your app · Save data with Firebase
- Add sign-up and sign-in pages · Add sign-in with Firebase
- Add sign-up and sign-in pages · Add sign-in with Clerk
- Create a key and save it in .env · Send emails with Resend
- Send one email your product needs · Send emails with Resend
- Create SMTP credentials and save them in .env · Send emails with Amazon SES
- Send one email your app needs · Send emails with Amazon SES
- Create a key and save it in .env · Send emails with SendGrid
- Send one email your product needs · Send emails with SendGrid
- Add reCAPTCHA and check it on the server · Stop bots with Google reCAPTCHA
- Add the keys to your host and test · Stop bots with Google reCAPTCHA
- Add Turnstile and check it on the server · Stop bots with Cloudflare Turnstile
- Add the keys to your host and test · Stop bots with Cloudflare Turnstile
- Add hCaptcha and check it on the server · Stop bots with hCaptcha
- Add the keys to your host and test · Stop bots with hCaptcha
- Create a key and save it in .env · Add AI features with the Claude API
- Add one AI feature · Add AI features with the Claude API
- Create a key and save it in .env · Add AI features with the OpenAI API
- Add one AI feature · Add AI features with the OpenAI API
- Create a key and save it in .env · Add AI features with the Gemini API
- Add one AI feature · Add AI features with the Gemini API
- Check your product before you put it online · Put your site online with Vercel
- Add your secret settings · Put your site online with Vercel
- Check your product before you put it online · Put your site online with Netlify
- Add your secret settings · Put your site online with Netlify
- Check your product before you put it online · Put your site online with Cloudflare
- Add your secret settings · Put your site online with Cloudflare
- Save your secret key in .env · Take payments with Stripe
- React when a payment succeeds · Take payments with Stripe
- Switch to real payments · Take payments with Stripe
- Save your client-side token in .env · Take payments with Paddle
- React when a payment succeeds · Take payments with Paddle
- Send Paddle’s events to your site · Take payments with Paddle
- Switch to real payments · Take payments with Paddle
- Save your access token in .env · Take payments with Polar
- React when a payment succeeds · Take payments with Polar
- Switch to real payments · Take payments with Polar
- Save your API key in .env · Take payments with Dodo Payments
- React when a payment succeeds · Take payments with Dodo Payments
- Pass the review and switch to live · Take payments with Dodo Payments
- How do the pieces talk to each other? · How the pieces fit
- What’s the fastest way to add AI to my product? · AI features
- Why does my product work on my computer but not online? · Debugging