Samprix

API Key Leak Checker

Find secret keys your website sends to every visitor: AI, payment and database keys in its JavaScript, readable source maps, and a downloadable .env file.

  • Public data only
  • Results in seconds
  • No sign-up
  • Free
Verdict No leaks found
Secret keys None
Source maps Hidden
.env and .git Blocked

Results for https://supabase.com/

Scanned the page and 40 scripts (4.1 MB); 24 more scripts were left out to stay within limits.

Secret keys

  • OK:No secret keys found in the code this site serves

    We looked for 36 kinds of secret, from AI and payment keys to database passwords and private keys.

.env and .git files

  • OK:No .env or .git files are served

    We tried /.env, /.env.local, /.env.production and /.git/config.

Source maps

  • OK:No source maps are served

    Your bundles can’t be turned back into readable source code.

Also worth a look

  • Note:Uses Supabase (project xguihxuzqibwxjnimxev)

    The browser talks to the database directly, so row level security is what keeps data private. Make sure RLS is on for every table, with policies that check auth.uid(); the dashboard’s Security Advisor lists tables without it. We don’t test this: it would mean reading your data.

  • OK:Supabase publishable key (public by design): sb_publis•••• (46 chars)

    Meant for the browser, as long as row level security is on for every table.

Advertisement

Why keys end up in the browser

Front-end frameworks copy some environment variables into the JavaScript they build, so the code can read them. Anything copied there is downloaded by every visitor. Each framework marks those variables with a prefix:

  • Next.js: NEXT_PUBLIC_…
  • Vite (React, Vue, Svelte, Lovable, Bolt): VITE_…
  • Create React App: REACT_APP_…
  • Expo: EXPO_PUBLIC_…
  • SvelteKit: $env/static/public and PUBLIC_… (private ones come from $env/static/private, which can’t be imported in browser code)
  • Nuxt: runtimeConfig.public

If a secret key has one of these prefixes, it’s public. AI coding tools often add the prefix to make an error go away, which is how many of these leaks start.

The fix: call the API from your server

  1. Revoke the leaked key at the provider and create a new one.
  2. Store the new key without the public prefix (OPENAI_API_KEY, not VITE_OPENAI_API_KEY), so it only exists on the server.
  3. Add a small server route that makes the call: a Next.js route handler, a SvelteKit +server.ts, a Supabase Edge Function, a Cloudflare Worker or a Vercel or Netlify function. The browser calls your route; your route calls the provider with the key.
  4. Protect that route: require a signed-in user, and rate-limit it, or it becomes a free proxy to your key.

Keys that are meant to be public

Stripe publishable keys, Supabase anon and publishable keys, Firebase config and Mapbox public tokens are built for the browser. They’re safe only when the backend enforces who can do what:

  • Supabase: turn on row level security for every table and write policies that check auth.uid(). Without RLS, the anon key can read and change every row.
  • Firebase: write Firestore, Realtime Database and Storage rules that check request.auth, and turn on App Check.
  • Google API keys: restrict each key to your website and to the APIs it needs in the Google Cloud console.

Turning off public source maps

  • Vite: build.sourcemap is off by default; if you need maps for error tracking, use 'hidden' and upload them to Sentry instead of deploying them.
  • Next.js: leave productionBrowserSourceMaps off (the default).
  • webpack: use devtool: 'hidden-source-map' and don’t deploy the .map files.

Blocking .env and .git on the server

Deploy only your build output folder, never the project root. As a backstop, refuse dotfiles at the web server. In nginx:

location ~ /\.(?!well-known) { deny all; }

In Apache, RedirectMatch 404 /\.(?!well-known). If .git was ever public, treat every secret in the repository’s history as leaked.

Did this tool do what you needed?

All tools