0 XP

What Vibe Coding Is (and Isn't) · Lesson 3

7 min

Keep Secrets Secret

Goal: Tell a public key from a secret key, and store secrets in environment variables that never reach the browser or your Git history.

0%
ReadStep 1 of 6

Keys are like keys

In plain English

A public key is like your shop's street address: it's fine if everyone sees it. A secret key is like the key to the safe: if someone copies it, they can take everything.

Services give you keys so your app can talk to them:

KindExample nameCan it go in the browser?
Publishable / publicVITE_CLERK_PUBLISHABLE_KEY, VITE_SUPABASE_PUBLISHABLE_KEYYes, it's designed for that
SecretCLERK_SECRET_KEY, SUPABASE_SECRET_KEY, STRIPE_SECRET_KEYNever

Anything in your front-end code (the part that runs in the browser) can be read by anyone who opens your site. Secret keys belong only on a server.

Quick check: Who can see a key that's inside your front-end code?