Blog · November 6, 2026
Does your API key have a public name?
If a secret key has a public prefix, anyone can read it in your site's JavaScript.
Many frameworks copy any variable with a special prefix into the code that runs in the browser. In Next.js it's NEXT_PUBLIC_. In Vite it's VITE_. AI tools sometimes add these prefixes just to make an error go away.
If a secret key has that prefix, anyone can read it in your site's JavaScript.
How to check:
- Open your live app and view the page source or the Sources tab in DevTools.
- Search the JavaScript files for
sk_,secret, orservice_role. - Check your
.envfor secret keys that start withNEXT_PUBLIC_orVITE_.
If you find one, rename it without the prefix, move that code to the server, and make a new key. Treat the old key as leaked.
VibeVigil scans your live app for exposed keys. Try it free: https://vibevigil.com
A short note. Not a promise.
If you want to know about your own site, run the free scan.
Scan a site you own. It is free. No account.
You see the report first. Saving the site is optional.