Guide
Secret key visible in your app? Or an admin page on your live app
How this guide was made: Written with AI assistance and checked against the sources linked on this page.
Updated
Your live app sends its code to every visitor's browser. If a secret key or an unprotected admin page ends up in that code, anyone who looks can use it: to read your customers' data, change it, or run up charges on your accounts. You will not see it happen.
Why it happens
Publishable keys are made for the browser. Secret keys, such as a Stripe secret key (sk_live_) or restricted key (rk_live_), and a Supabase secret key (sb_secret_) or its older service_role key, bypass the protections and must stay on a server. Supabase rejects a secret key sent from a browser, but anyone who copies it can still use it from other tools.
How to check your live app for a secret key
- Open your live app in a private (incognito) window, so you see what a stranger sees.
- Press F12 to open Chrome DevTools, open the Sources tab, then press Ctrl+Shift+F (Cmd+Option+F on Mac) to search every file the page loaded.
- Search for each of these, one at a time:
sk_live_: a Stripe secret keyrk_live_: a Stripe restricted keysb_secret_: a Supabase secret keysk-proj-orsk-: an OpenAI keyeyJ: a token. Paste each match into a JWT decoder; if it shows "role": "service_role", it is Supabase's old secret key.
- Open the Network tab and use the app. If a request goes from the browser straight to api.stripe.com or api.openai.com, the key behind it is in the browser.
- Type /admin, /dashboard and /settings after your app's address while signed out. If the page or its data loads, it is exposed.
Which keys are safe in the browser?
| Key | Looks like | Safe in the browser? |
|---|---|---|
| Stripe publishable key | pk_live_... | Yes, made for the browser |
| Stripe secret or restricted key | sk_live_... / rk_live_... | No, server only |
| Supabase publishable key | sb_publishable_... | Yes, with row-level security on |
| Supabase legacy anon key | eyJ... with "role": "anon" | Yes, with row-level security on |
| Supabase secret key | sb_secret_... | No, it bypasses row-level security |
| Supabase legacy service_role key | eyJ... with "role": "service_role" | No, it bypasses row-level security |
| OpenAI API key | sk-proj-... | No, server only |
Possible causes
- A secret key was placed in front-end code instead of a server-side function.
- An admin page is reachable by its address without signing in, and only the link to it is hidden.
- The data request behind an admin page does not check on the server that the person is an admin.
- Row-level security is off on a table, so the public key can read everything in it.
- Uploaded files are in a public storage bucket that anyone with the address can open.
You can't see it yourself
You're signed in, your customers aren't. You are signed in as the owner, so every page works for you. Nothing looks wrong, and a stranger can see what you cannot.
Related: Users can see other users' data in my Lovable app · Data won't save: "new row violates row-level security policy" · My builder says the app is tested, but my customers hit problems
VibeFix is independent. Lovable, Bolt, Replit, Base44, v0, Supabase, Firebase, Stripe and Vercel are trademarks of their owners.
More guides · Shopify store accessibility · About · Your privacy choices