A Twitch API token acts for a Twitch developer application or for a viewer who has authorized one. Depending on the token type, it can call the Twitch API to read channel and stream information, manage chat or moderation features, or act on the behalf of the account that granted access. Twitch tokens are not payment credentials, but they can change what your channel or your community sees, and a token tied to a broadcaster can alter that broadcaster’s settings. Treat a leak as an incident for the account it belongs to.
Check your GitHub account for leaked secrets — free
- Provider
- Twitch
- Severity
- High
- Impact
- SaaS account access and billing
- Checked live by LeakWatch
- No
What a Twitch API Token looks like
Twitch tokens and client secrets have no distinctive prefix. They are strings of 30 lowercase letters and digits, and they are usually found in a configuration file next to the word “twitch”, as in an assignment such as TWITCH_CLIENT_SECRET=…:
TWITCH_CLIENT_SECRET=… Twitch API secret (masked)
Because there is no prefix, the context is what identifies the value. The client ID, which identifies your application, is not secret, but the client secret is, and so is any user access token that a script stores. Check which of these you are looking at before you act, since the response differs: a client secret needs rotation of the application, while a user token is revoked for the user who granted it.
How Twitch API Tokens get leaked
- Bot configuration. A chat bot’s settings file committed with the client secret filled in, which is common for projects started as a quick script.
- Streaming tools. An overlay or an alert tool that stores the token in a file the streamer shares on screen or in a support request.
- Environment templates. An example configuration where the real value was left in place after testing.
- Logs. A bot that prints its configuration when a connection fails.
- Browser code. A token placed in a web page for a widget, where anyone viewing the page source can read it.
What to do in the first hour
- Rotate the client secret. Open the account settings for your Twitch developer application and generate a new client secret. Once the new value is in place, the old one should no longer be accepted.
- Revoke user tokens if the leak included an access token. Revoking the token ends the access that the user granted, and the user can authorize the application again later.
- Deploy the new values to the bot or tool that uses them, and check that it can still connect and act on the channel.
- Review the channel. Look at moderator lists, banned-word settings, channel points configuration and any other settings the token could change. Restore anything you did not change.
- Check the application’s redirect addresses and remove any you do not recognize, because a foreign redirect can receive authorization codes.
- Look at other secrets in the same file, such as bot passwords and streaming platform keys. See I accidentally pushed an API key to GitHub for the order of steps.
- Clean the code. Read the secret from an environment variable, keep it out of browser code, and remove the value from current files.
Not sure what else leaked? Run a free scan.
Revoke it at Twitch
Application secrets are managed in the Twitch developer console, under your application’s settings. Open account settings, select the application, and generate a new client secret. User tokens are managed through the account’s connections page, where the user can disconnect an application. We have not confirmed the current button labels, so check the wording on the page you see, and make sure you are signed in to the account that owns the application.
How LeakWatch detects it
The rule is called Twitch API Token. It looks for the word “twitch” followed, within a short distance, by an assignment-style separator and a value of exactly 30 lowercase letters or digits, with a boundary after it. Values in uppercase or of another length are not reported by this rule. The severity is high, with the impact class for SaaS tools. This type is not checked live: LeakWatch does not try the value against Twitch.
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 the client ID also a secret?
No. It identifies the application and is often visible in public settings. The client secret is the value that must stay private.
Does rotating the secret log my users out?
Not necessarily. Rotating the application secret changes what your server uses to authenticate. Users who authorized the app keep their connections unless you revoke their tokens separately.
What if the leaked value was a user token?
Revoke that token. The user can then authorize the application again, which issues a fresh token that you store securely.