Exposed API key checker for NEXT_PUBLIC_ and VITE_ variables

Drop your project folder or paste a .env file to find secret keys that your bundler ships to every visitor.

Run the check

Drop a project folder or files here

node_modules, .git, virtualenvs and build folders are skipped. Limit 25 MB / 5,000 files.

The Python engine (Pyodide, a few MB, cached by your browser) loads when you start.

The mistake

Putting a secret key in a variable with a public prefix: NEXT_PUBLIC_, VITE_, REACT_APP_, EXPO_PUBLIC_, PUBLIC_ or NUXT_PUBLIC_. Also: keys hard-coded in source, keys inside built JavaScript, and real-looking keys in .env.example.

Why it is dangerous

Bundlers copy every variable with a public prefix into the JavaScript sent to every visitor. A secret key there is public the moment you deploy: anyone can open DevTools, copy it and spend your credits or read your data. Bots scan deployed bundles for exactly these keys. Files in dist/, build/, out/ and .next/static are exactly what your host serves, and shipped .map files let anyone rebuild your original source.

How to fix it

  1. Rotate the key now. Every build made with the old value contains it, and old deploys and CDN caches keep serving it.
  2. Rename it without the public prefix so the bundler never inlines it, e.g. NEXT_PUBLIC_OPENAI_API_KEY → OPENAI_API_KEY, set in .env.local (git-ignored) and in your host's environment settings.
  3. Use it only in server code, and let the browser call your own endpoint instead.

What this checker looks for

This page runs key-leak-check, which reads .env files, frontend source and build output (dist/, build/, .next/static). The rules most relevant to this page:

RuleWhat it finds
KLC001Secret in a browser-exposed env var
KLC002Client code reads a secret through a public env var
KLC004API key hard-coded in source
KLC005API key inside built JavaScript bundle
KLC006Source maps shipped with the build
KLC008Real-looking key in an env example/template

Every finding has a rule id, a severity, file:line, the offending line (secrets masked), why it matters and how to fix it. Run key-leak-check rules for the full list.

FAQ

Are publishable keys reported?

No. Keys meant for the browser (Supabase anon / publishable keys, Stripe publishable keys and similar) are recognised and not reported. The checker looks for secret key formats.

Does it show my keys?

No. Secret values are masked in every finding, exactly as the command-line tool does, and nothing leaves your browser anyway.

Should I scan my build output?

Tick "Also scan build output" to include dist/, build/, out/ and .next/static. That is what your host serves, so a key found there is public whatever the source looks like now.

Are my files uploaded anywhere?

No. The checker is Python running inside your browser tab (Pyodide, WebAssembly). Your files are read with the browser's File API and written into an in-memory file system that exists only in this tab. Your files are never sent anywhere. The only network requests load the Python runtime and the checker code, plus Google Analytics page-view counting, which never sees your files. You can disconnect from the internet after the engine has loaded and the scan still works.

Is a clean report a guarantee?

No. It is a static check for known patterns, not a penetration test. A clean report means none of these patterns were found, nothing more.

Can I run the same check on my machine or in CI?

Yes. Every checker on this site is an open-source command-line tool (MIT licence, Python 3.10+ standard library only). The results here are the same as `scan --json` on the command line, except for checks that need git (whether a file is committed or ignored), which cannot run in a browser.