# Check your website's JavaScript for exposed API keys and keep your accounts in your hands.

> Check the JavaScript your homepage loads for secret API keys, private keys and admin tokens, and tell them apart from keys that are meant to be public.

Source: https://scandefend.com/checks/exposed-secrets

Exposed keys check

Runs in every scan · 7 checks

Find secret keys left in code every visitor downloads, and see which visible keys are perfectly normal.

-   No card for the free check
-   Results usually in minutes
-   $8 for 1 check, $18 for 5, $59 for 20 (+ applicable tax)
-   No subscription needed
-   [View sample report](https://scandefend.com/sample-report?utm_source=ai&utm_medium=referral&utm_campaign=ai-md&utm_content=checks-exposed-secrets)

The short answer

Build tools sometimes copy a secret key into public JavaScript. We read the scripts your homepage loads, spot values shaped like secret keys and tokens, and separate them from keys that are designed to be public, so you only act on the ones that matter.

[See a sample report](https://scandefend.com/sample-report?utm_source=ai&utm_medium=referral&utm_campaign=ai-md&utm_content=checks-exposed-secrets) [All checks](https://scandefend.com/checks?utm_source=ai&utm_medium=referral&utm_campaign=ai-md&utm_content=checks-exposed-secrets)

What we check

## What we look at. Evidence and plain-English fixes.

Part of every Quick Scan, alongside [the other checks](https://scandefend.com/checks?utm_source=ai&utm_medium=referral&utm_campaign=ai-md&utm_content=checks-exposed-secrets).

-   ### Secret keys in public scripts

    Payment, cloud, email, code-hosting and chat keys.

-   ### Private keys and admin tokens

    Signing keys and tokens that carry admin rights.

-   ### Keys meant to be public

    Publishable and browser keys shown as normal, with a tip on restrictions.

-   ### Key-shaped comments

    Values that look like keys inside HTML comments.

-   ### Internal details

    Internal network addresses and technical error pages on your homepage.

-   ### API addresses

    A note when your pages reference many API addresses.

-   ### Linked documents

    The documents and data files your homepage links to, and any with private-sounding names.

Why it matters

## Small settings. A big difference for your visitors.

-   ### Accounts stay yours

    Catch a leaked key before anyone uses it.

-   ### No surprise bills

    Cloud and email keys can't be spent by others.

-   ### Calm about the normal ones

    Public-by-design keys are labelled as such.

What a finding looks like

## Plain English. With the evidence behind it.

[Open the full sample report](https://scandefend.com/sample-report?utm_source=ai&utm_medium=referral&utm_campaign=ai-md&utm_content=checks-exposed-secrets)

K1 · exposed-keys

### Move an email-sending key out of your public JavaScript

High Likely Hours

What it means

A value shaped like an email service API key is written into a script every visitor downloads. Moving it to your server and issuing a new key keeps your email account in your hands.

Evidence

```
/assets/app.js
SG.••••••••••••.••••7Qx  (shown shortened)
```

Fix

Revoke the key in the provider's dashboard, issue a new one, and call the provider from your server so the key never reaches the browser.

How to fix it

## A few clear steps. In the order to take them.

Your report has the exact fix for your site, ready to forward to whoever looks after it.

1.  Revoke the exposed key in the provider's dashboard and issue a new one.

2.  Call the provider from your server or a serverless function, so the key never reaches the browser.

3.  Restrict keys that are meant to be public to your own domain, and check their access rules.

4.  Add a secret scanner to your build so a key can't slip into a bundle again.

Keep the key on the server

```
// server-side only, never in the browser bundle
const key = process.env.EMAIL_API_KEY;
```

Questions

## Exposed keys questions.

Something else? [support@scandefend.com](mailto:support@scandefend.com)

**Is it a problem if my Stripe publishable key is visible?**

No. Publishable keys, Firebase web configuration and Supabase anon keys are made to be shipped to browsers. The report shows them as normal and suggests checking their restrictions and access rules in each provider's dashboard.

**I've found a secret key in my JavaScript. What now?**

Revoke it and issue a new one first, then move the code that uses it to your server. Removing it from the script alone isn't enough, because copies may already exist.

**Do you use or store the keys you find?**

Never. We don't try a key, and the full value isn't stored: the report shows a shortened form so you can recognise it.

**Which scripts do you read?**

The scripts your homepage loads, including ones from your own build and from other sites. Code that only loads after sign-in sits outside a Quick Scan.

Keep exploring

## Related checks. All part of the same Quick Scan.

-   [6 checks Outdated software Old versions, plugins and known vulnerabilities in what we find.](https://scandefend.com/checks/outdated-software?utm_source=ai&utm_medium=referral&utm_campaign=ai-md&utm_content=checks-exposed-secrets)
-   [8 checks Security headers HSTS, CSP and the other browser protections your site turns on.](https://scandefend.com/check-security-headers?utm_source=ai&utm_medium=referral&utm_campaign=ai-md&utm_content=checks-exposed-secrets)
-   [Verified sites · 7 checks Exposed files Sensitive files left online by mistake.](https://scandefend.com/checks/exposed-files?utm_source=ai&utm_medium=referral&utm_campaign=ai-md&utm_content=checks-exposed-secrets)

Also useful: [What we check](https://scandefend.com/checks?utm_source=ai&utm_medium=referral&utm_campaign=ai-md&utm_content=checks-exposed-secrets) [Sample report](https://scandefend.com/sample-report?utm_source=ai&utm_medium=referral&utm_campaign=ai-md&utm_content=checks-exposed-secrets) [Pricing](https://scandefend.com/pricing?utm_source=ai&utm_medium=referral&utm_campaign=ai-md&utm_content=checks-exposed-secrets) [For developers](https://scandefend.com/for/developers?utm_source=ai&utm_medium=referral&utm_campaign=ai-md&utm_content=checks-exposed-secrets)

## See what your website shows. Know what to fix first.

[See pricing](https://scandefend.com/pricing?utm_source=ai&utm_medium=referral&utm_campaign=ai-md&utm_content=checks-exposed-secrets)

Every Quick Scan 11 areas

-   HTTPS and redirects
-   Encryption (TLS) test
-   Security headers
-   Email security
-   Outdated software and plugins
-   Known vulnerabilities
-   Cookie security
-   Google blocklist
-   Exposed keys
-   Exposed files (verified sites)
-   DNS health

One report, with plain-English fixes

These are the USD list prices; the website shows each visitor prices in their own local currency, which vary by country.
