VibeFix

Guide

Secret key visible in your app? Or an admin page on your live app

Published by Yosef D., founder of VibeFix

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.

Fixed in your code, then tested live. Get it fixed: a free check first confirms the problem on your live app, usually in 4 to 10 minutes.

Free. No account needed. It usually takes 4 to 10 minutes.

Want it fixed? For Lovable apps or code on GitHub, our AI agent fixes it in your code for $79 and tests your live app again. If we can't complete your re-check, you get your money back.

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

  1. Open your live app in a private (incognito) window, so you see what a stranger sees.
  2. 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.
  3. Search for each of these, one at a time:
    • sk_live_: a Stripe secret key
    • rk_live_: a Stripe restricted key
    • sb_secret_: a Supabase secret key
    • sk-proj- or sk-: an OpenAI key
    • eyJ: a token. Paste each match into a JWT decoder; if it shows "role": "service_role", it is Supabase's old secret key.
  4. 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.
  5. 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?

KeyLooks likeSafe in the browser?
Stripe publishable keypk_live_...Yes, made for the browser
Stripe secret or restricted keysk_live_... / rk_live_...No, server only
Supabase publishable keysb_publishable_...Yes, with row-level security on
Supabase legacy anon keyeyJ... with "role": "anon"Yes, with row-level security on
Supabase secret keysb_secret_...No, it bypasses row-level security
Supabase legacy service_role keyeyJ... with "role": "service_role"No, it bypasses row-level security
OpenAI API keysk-proj-...No, server only

Possible causes

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