API Key Leak Checker
Leaked key checker for built JavaScript
Use this if an AI built your front end and you want an API key leak checker to find keys in the JavaScript your site sends to every visitor.
Paste the JavaScript your site ships and find API keys left in it: AWS keys, private keys, Stripe, OpenAI, Slack and Google keys, Supabase service_role keys, and secret-named values. It uses the same key rules the installed audit runs over your source.
You can link to this tool with the box already filled in, and it waits for you to press the button. Example:
https://vibecoderplayground.ai/free-vibe-coding-tools/api-key-leak-checker.html?source=const%20config%3D%7BapiKey%3A%22FAKEFAKEFAKEFAKE1234%22%7D%3B
What it reads
This reads the JavaScript you pasted for text shaped like a key. Each match is something to look at, not a verdict: nothing here can tell a live key from a revoked or test one.
- AWS access key ids: AKIA followed by 16 capital letters or digits
- A private key block that starts with BEGIN PRIVATE KEY (RSA, EC, OpenSSH, DSA or PGP)
- Provider key shapes: Stripe live secret keys (sk_live_, rk_live_), OpenAI-style keys (sk-, sk-proj-), Slack tokens (xoxb-, xoxp-), Google API keys (AIza), and a Supabase key whose payload says service_role
- A value of 16 or more key characters assigned to a name such as apiKey, secret, token, password or SOME_SERVICE_KEY
- Values that read as placeholders (example, changeme, your_, xxxx, process.env) are skipped, only in the piece of code they sit in
What it does not look at
- whether a key it flags is real or still works. Nothing here calls any service, so a revoked or test key looks the same as a live one
- a key split across strings or put together while the page runs. It reads the text as pasted, so a key built from pieces is not seen
- the rest of your build. One paste holds up to 65,536 characters, so a larger bundle has to be checked one file or one chunk at a time
- a key that reaches the browser only after the page loads, such as a value an API sends back, or anything in a source map you did not paste
- key formats other than the ones listed under What it reads. A key from another provider with no secret-sounding name beside it is not flagged
- your server code or your commit history. It reads only the JavaScript you pasted
What to do with the result
Start with the first key on the list. Revoke or roll it at the service that issued it before you touch the code, because the files you already shipped are cached and copied, and a new build does not take them back.
Then move the call that uses the key to your server or a serverless function, and keep the new key there. Only a key made to be public, such as a Stripe pk_ key or a Supabase anon key, belongs in the browser.
Run Next
- AI Code Risk Scanner: check your source files, not only the build, for eval, HTML sinks, injection shapes and the same key rules.
- SaaS Maturity Check: see what else your app needs before real people use it.
- Free SEO Checker: check the page that loads this JavaScript.
The full audits these checks come from run in Vibe Coder Playground, on your own project: see the Playground download.
Questions about leaked API keys
- Why would an API key be in my JavaScript?
- Build tools copy any value your front-end code reads into the files they ship. In Vite that is every
VITE_variable, in Next.js everyNEXT_PUBLIC_variable, and in Create React App everyREACT_APP_variable. An AI that put a secret key in one of those, or typed it straight into the code, has sent it to every visitor. - Where do I find my built JavaScript?
- Run your build and open the dist, build or .next/static folder. Or open your live site, open the browser's developer tools, go to Sources, and copy a script file. One paste holds up to 65,536 characters, so check a large bundle one file or one chunk at a time.
- It found a key. What do I do first?
- Revoke or roll the key at the service that issued it, before you change any code. Removing it from the next build does not help: the old files are already cached and copied. Then make a new key and move the call that uses it to your server or a serverless function.
- Are some keys meant to be public?
- Yes. A Stripe publishable key (pk_) and a Supabase anon key are made to ship in the page, and the checker does not flag them. Google AIza keys, which Firebase uses too, can be either, so the checker flags them: check that yours is restricted to your site and the APIs it needs.
- Is my code uploaded?
- No. The checker runs in your own browser, so what you paste never reaches us, and it makes no AI call. It also never shows a key whole: each result keeps the first and last four characters only.