# Leaked Stytch API Key? Rotate It and Audit Sessions

> Stytch API key exposed in a repo or app bundle? Rotate the secret in your dashboard, review sessions and users and move the key to your server. Guide.

Source: https://leakwatch.net/secrets/stytch-api-key

---

[LeakWatch](/)

[Product](/product)[Live feed](/leaks)[Guides](/secrets)[Blog](/blog)[Free scan](/)

1.  [Home](/)
2.  [Secrets](/secrets)
3.  Stytch API Key

Databases & keys · Secret guide

# Leaked Stytch API Key: what to do in the first hour

High severityDetected onlyLast verified November 5, 2026 · 5 min read

A Stytch API key is the server-side secret that an application uses to call Stytch, the authentication service. Stytch issues a project identifier and a secret for each environment, and the secret is what authorizes server calls: creating and managing users, revoking sessions and changing authentication settings. Whoever holds a secret from a live project can act as your authentication backend, which is one of the most sensitive positions in an application. Rotate the secret first, then check the users and sessions that may have been touched.

[Check your GitHub account for leaked secrets — free](/)

Provider

Stytch

Severity

High

Impact

SaaS account access and billing

Checked live by LeakWatch

No

## What a Stytch API Key looks like

The secret that this rule looks for is a value of forty-seven letters, digits, underscores and dashes, ending in an equals sign, and it appears near the word `stytch` in a file:

```text
stytch … XXXX=   value near the Stytch name (masked)
```

This guide could not confirm the exact format of every Stytch secret against Stytch’s documentation, so do not rely on the shape alone to decide whether a value is a Stytch secret. The reliable test is where it sits: a secret in a file that calls the Stytch API, next to the project identifier or the environment name, is a live credential. Stytch uses separate values for its test and live environments, so check which environment a secret belongs to before you decide how urgent the rotation is.

Stytch also publishes a public token for client-side SDKs. That value is designed to be used in a browser, so its exposure is far less serious than the secret. Do not assume every Stytch value is a secret, but do assume that the secret, which the server holds, must never reach a browser or a mobile app.

## How Stytch API Keys get leaked

-   **Front-end bundles.** A secret placed in code that runs in the browser, usually because the developer used a server SDK in the wrong place. Anyone can read it from the bundle.
-   **Committed environment files.** A `.env` file with the secret, pushed to a repository that was public at some point or shared with people who should not see it.
-   **Deployment configuration.** A container or serverless setting that writes the secret into a file in the image or the source tree.
-   **Build logs.** A CI step that prints its environment, or a debug option that echoes the request sent to Stytch.
-   **Shared examples.** A snippet pasted into a support question or a tutorial, with the real secret left in the request.

## What to do in the first hour

1.  **Rotate the secret.** Open the project settings in the Stytch dashboard, go to the project identifier and API keys section, and rotate or replace the secret for the environment that leaked. Confirm which environment it belongs to first, because test and live secrets are separate.
2.  **Update your server** with the new secret, and store it in a secret manager or in the server’s environment. Remove the old value from every place it was copied to.
3.  **Review sessions and users.** Check the users created or changed, and the sessions that were issued or revoked, for the period since the secret may have been exposed. Look for accounts you did not create and sessions from unfamiliar places.
4.  **Check authentication settings.** Review the redirect URLs, the allowed origins and the authentication methods enabled for the project. A changed redirect URL can be used to steal sign-in results.
5.  **Check the other secrets** in the same file. Rotate any database password, email key or webhook secret that was stored with it.
6.  **Clean the code** after the rotation. Move the value out of the browser code and the repository, and check the history for older copies. See [I accidentally pushed an API key to GitHub](/blog/i-accidentally-pushed-an-api-key-to-github).

Not sure what else leaked from the same project? [Run a free scan](/).

[Not sure what else leaked? Run a free scan.](/)

## Revoke it at Stytch

Stytch’s documentation says the project identifier and the API keys for each environment are found in the Project ID and API keys section of the dashboard. Open the project settings there and look for the option to rotate or replace the secret. The documentation consulted for this guide did not confirm the exact steps for rotating a project secret, and it describes a separate rotation flow for machine-to-machine clients, which is not the same thing. Check the dashboard for the current option, and if you cannot find one, contact Stytch support before you assume the old secret is gone. Stytch’s public documentation on API keys is a useful reference.

## How LeakWatch detects it

The rule is called “Stytch API Key”. It looks for the word `stytch` followed, within about forty characters, by a value of forty-seven letters, digits, underscores or dashes that ends in an equals sign, with a word boundary before it. The match is case-insensitive, and the value must come after the name. A value of the same shape with no Stytch name close by is not reported. The severity is **high**, with the impact class for SaaS services. **This type is not checked live**: LeakWatch does not call Stytch with the value it finds.

LeakWatch detects this format but does **not** check it live: it can tell you the key is exposed, not whether it still works. Assume it does until you have revoked it.

## FAQ

Is a Stytch public token a secret?

Stytch’s public tokens are meant for client-side use, so they are not treated the same way as a server secret. The server secret is the one to rotate urgently. Check which kind of value you found before you decide.

Do I need to log every user out?

Not always. Revoking sessions is a separate action from rotating the secret. Rotating the secret protects your server calls. If you think sessions were stolen, revoke them as well, using the session tools in the Stytch documentation.

Which environment should I rotate?

The one the leaked secret belongs to. Test and live environments have separate secrets, so a leaked test secret needs a different response from a leaked live one.

## Related

-   [Auth0 Management API Token](/secrets/auth0-management-api-token)
-   [Okta API Token](/secrets/okta-api-token)
-   [JWT (JSON Web Token)](/secrets/jwt-token)
-   [I accidentally pushed an API key to GitHub](/blog/i-accidentally-pushed-an-api-key-to-github)
-   [Which vendors leak most this week](/leaks/trends)
-   [All secret guides](/secrets)

[Get alerted next time a secret leaks — create a free account](/)

LeakWatch is not affiliated with Stytch.

![Gabriel Diyan, founder of LeakWatch](/brand/Photo-Gabriel-Diyan.webp)

Gabriel Diyan (0xCr0c0)

Cybersecurity student, founder of LeakWatch. I built and run the scanner described here — the detection patterns, the false-positive classifier and the provider validators are mine. [More about who I am](/about).

[GitHub](https://github.com/Leakwatch-Scan) · [X](https://x.com/LeakwatchScan) · [LinkedIn](https://www.linkedin.com/in/gabriel-diyan-80a378375) · [GitHub (personal)](https://github.com/crocogab)

LeakWatch

Secrets leak into public commits every minute. This watches the forges for yours. Built and run by [Gabriel Diyan](/about), a cybersecurity student — [why LeakWatch exists](/about).

Scan

-   [Product](/product)
-   [Live feed](/leaks)
-   [Trends](/leaks/trends)
-   [API docs](/docs)
-   [CI/CD](/docs?tab=ci)

Read

-   [Blog](/blog)
-   [Secret guides](/secrets)
-   [Changelog](/changelog)
-   [About](/about)

Verify

-   [Security](/security)
-   [Privacy](/privacy)
-   [Terms](/terms)
-   [Legal](/legal)
-   [Contact](/contact)
-   [Status](https://status.leakwatch.net)

© 2026 LeakWatch

[GitHub](https://github.com/Leakwatch-Scan)[X](https://x.com/LeakwatchScan)
