Watch: Put my API keys in a .env file the safe way | Vovy

Watch Vovy do it on a Mac: "Set up a .env file for my Supabase and OpenAI keys and keep it out of git". Vovy creates a .env.local file with the right variable names for your framework, checks .gitignore so keys never hit GitHub, and adds a .env.example.

"Set up a .env file for my Supabase and OpenAI keys and keep it out of git"

Vovy creates a .env.local file with the right variable names for your framework, checks .gitignore so keys never hit GitHub, and adds a .env.example.

What happens in the video

  1. Detect your framework: Vovy reads package.json to see if you use Vite, Next.js or Expo, since each needs a different prefix like VITE_, NEXT_PUBLIC_ or EXPO_PUBLIC_.
  2. Collect keys from dashboards: Vovy opens Supabase Project Settings, API Keys and your OpenAI API keys page in your signed-in browser, and copies only what the app needs.
  3. Write .env.local: Vovy creates the file and labels which keys are public, safe in the browser, and which are secret and must stay on the server.
  4. Lock it out of git: Vovy checks .gitignore covers .env files and runs git status to prove the file is not staged for a commit.
  5. Add a .env.example: Vovy writes a copy with blank values for teammates, restarts your dev server, and shows a card of every variable and where it came from.
Read the step-by-step guide