AppInspected

Is this API key safe to put in my frontend?

Paste a key (or a whole .env line) to see whether it's a secret that must stay on a server or a public key made for the browser. It runs in your browser: the key is never sent anywhere. Then check your live site for every key at once.

Checked in your browser only. Nothing is sent or stored.

Free. No sign-up. We only read what your visitors' browsers already read.

Passive and read-only. Works with any public site, including apps built with Lovable, Bolt, v0, Replit, Base44, Cursor, Windsurf and Claude Code.

AppInspected
Site
Waiting for your address
Checked
–
Critical issues
–
Not checked yet
Your result fills in this tag. Nothing is stored.

Secret or public: the short answer

A key is safe in browser code only if the provider designed it to be public. Everything your site sends to the browser, every JavaScript file included, can be read by anyone in a few seconds, so "hidden in the code" never counts. Environment variables don't help either when their name starts with VITE_, NEXT_PUBLIC_, REACT_APP_ or EXPO_PUBLIC_: those prefixes tell the build tool to copy the value into the public bundle (secrets in VITE_ variables, secrets in NEXT_PUBLIC_ variables).

Common keys: which belong in the browser
KeyLooks likeIn the browser?
Stripe publishable keypk_live_, pk_test_Yes, made for it
Stripe secret or restricted keysk_live_, rk_live_, sk_test_No: Stripe secret key exposed
Supabase anon or publishable keyJWT with role anon, sb_publishable_Yes, if Row Level Security is on for every table: Is the Supabase anon key safe?
Supabase service_role or secret keyJWT with role service_role, sb_secret_Never: Supabase service_role key exposed
Firebase web config / Google Maps keyAIza…Yes, but restrict it to your domains and APIs: Google API key in your website code
OpenAI, Anthropic API keyssk-proj-, sk-ant-api…No, there's no browser-safe version: OpenAI API key in your frontend, Anthropic API key exposed
AWS access keyAKIA… + a secret keyNo: AWS access key exposed
GitHub, Slack tokensghp_, github_pat_, xoxb-No: GitHub token exposed, Slack token exposed
SendGrid, Resend, Twilio keysSG., re_, SK + 32 hexNo: SendGrid or Resend key exposed, Twilio API key exposed
Mapbox tokenpk. (public), sk. (secret)pk. yes, with URL restrictions; sk. no
Database URL, private keypostgres://user:pass@, -----BEGIN PRIVATE KEY-----Never: database URL exposed, private key (service account key) exposed

Is the tool safe to paste a real key into?

Yes. The check above is a small script that runs on this page in your browser and matches the key's format, the way the prefixes in the table do. It makes no network request, doesn't store anything and doesn't try the key with the provider, so it can't tell whether a key is still active. If you'd rather not paste it at all, the first few characters are usually enough: sk_live_ or pk_live_ tells you most of the story.

For Supabase keys that are JWTs (they start with eyJ), the tool decodes the middle part, which isn't encrypted, and reads the role: anon is the public key, service_role is the master key.

Found a secret? Do this, in this order

  1. Rotate it now

    Create a new key in the provider's dashboard and revoke the old one. Taking it out of your code isn't enough: old copies of your JavaScript stay in browser caches and archives, and automated scanners copy keys within minutes.
  2. Move the call to a server

    Put whatever needed the key (payments, AI requests, email, admin database access) in a server function: an API route, a Supabase Edge Function, a Cloudflare Worker. Read the key from a server-only variable, without a public prefix. AI apps: call OpenAI from a Supabase Edge Function.
  3. Protect that endpoint

    Require a signed-in user and rate-limit it, or you've built a free proxy for whoever finds it. For AI providers, set a hard monthly spend limit too.
  4. Check the live site

    Deploy, then paste your site's address in the check above. It searches your page and up to 25 of its JavaScript files for every key in the table at once.

When "public" isn't the same as "safe"

Supabase and Firebase put a public key in your app on purpose: the browser talks to the database directly. That's only safe if Row Level Security (Supabase) or Security Rules (Firebase) stop strangers on every table and collection, and no outside check can see those rules. In our check of 364 newly launched apps, nobody leaked a secret key, but 44 ran on Supabase or Firebase where the real question is the database rules. Check yours: Supabase RLS disabled, Firestore test mode rules.

The $19 website security report covers that gap: after you prove you own the site, it reviews up to 30 pages and 40 scripts and adds optional read-only database tests. You create two test accounts and a test record, and we check whether a signed-out visitor or the other account can read it. If the report can't be completed or comes out broken, you get a full refund.

Website security report

$19 one time

For any website you own: a read-only review of up to 30 pages and 40 JavaScript files (found through your build manifest, routes and sitemap), app logic in the browser (admin and paid-feature checks, prices sent from the browser, AI APIs called directly), headers, cookies and CORS, domain and email records, libraries with known vulnerabilities, forgotten files and third-party scripts, with fixes written for your host. Optional database tests for Supabase or Firebase. Requires proof you own the site.

Example report header: a score out of 100, findings by severity, Download PDF and Email me this report.See an example reportGet the report

Badge + daily monitoring

$9 per month

We repeat the outside checks every day and email you when something changes: a new key in your JavaScript, a removed header, a new third-party script, a certificate about to expire. Includes a live badge and one full website report every 30 days.

How monitoring works

Questions

Is it safe to put an API key in frontend JavaScript?

Only if the provider designed the key to be public: Stripe publishable keys (pk_), Supabase anon or publishable keys, Firebase web config and Mapbox public tokens. Keys that can spend money, send email or read private data must stay on a server.

Is my Supabase anon key safe to expose?

Yes, the anon key and the newer sb_publishable_ key are meant to be in browser code, but only if Row Level Security is on for every table they can reach. The service_role and sb_secret_ keys are never safe in the browser.

Is the Firebase API key a secret?

No. The Firebase web API key (AIza…) identifies your project and has to be in the browser. Your data is protected by Security Rules, not by hiding the key. Restrict the key to your domains and APIs in the Google Cloud console so it can't be used for paid APIs such as Gemini.

Can I hide an API key in a .env file in React, Vite or Next.js?

Not if browser code reads it. Vite copies VITE_ variables into the bundle, Next.js does the same with NEXT_PUBLIC_, Create React App with REACT_APP_ and Expo with EXPO_PUBLIC_. A .env file only hides a key that is read by server code.

Does this tool send my key anywhere?

No. It runs in your browser and makes no network request. It also can't tell whether the key still works, because that would mean sending it to the provider.

I removed the key from my code. Do I still need to rotate it?

Yes. Old versions of your JavaScript stay in caches and archives, and scanners copy exposed keys within minutes. Revoke the old key and create a new one.

How do I check my whole site for exposed keys?

Paste your site's address in the check at the top of this page. It's free, takes about 20 seconds and searches your page and its JavaScript for every key type in the table.

More free checks and guides