Catch your favorite Twitch moments.
inb4 is a Chrome extension that watches the pace of Twitch chat and sends a desktop notification when conversation suddenly spikes. It learns each channel's normal activity, so alerts are based on unusual momentum instead of a single fixed message threshold.
- Robust multi-scale detection: Compares 3, 8, 20, and 30-second chat activity with a lagged, rolling per-channel baseline.
- Crowd confirmation: Uses distinct chatter participation and short persistence to distinguish broad reactions from single-user floods or one-bucket delivery noise when enough chatter data is available.
- Up to 10 channels: Track several Twitch communities from one extension.
- Adjustable sensitivity: Choose the default for newly added channels, then configure each channel independently.
- Desktop notifications: Jump back when chat suggests something worth seeing is happening.
- Optional clip creation: Set the default for new channels, then enable or disable clip creation independently per channel with additional Twitch permission.
- Live status: View message rate, baseline activity, connection health, and the last alert in the popup.
- Local-first storage: Settings, tracked channels, and Twitch authorization data stay in Chrome's local extension storage.
- You connect a Twitch account and add channels to track.
inb4subscribes to Twitch chat events through EventSub.- The extension groups chat into one-second buckets and learns a robust five-minute baseline that excludes the most recent 30 seconds.
- It scores 3, 8, 20, and 30-second windows, confirms high-volume reactions with distinct chatter participation across two nearby one-second buckets when possible, and ignores periods where EventSub coverage was unavailable.
- When activity rises far enough above that baseline,
inb4waits for at least one Twitch clip created within the recent confirmation window before sending a notification, subject to the configured cooldown. - If optional clip creation is enabled, the extension can request an additional Twitch clip alongside the alert.
The background process is designed for Chrome Manifest V3 and uses alarms to recover from service-worker suspension and EventSub interruptions. Compact count-based detector state is checkpointed to Chrome session storage so an ordinary service-worker restart does not force a complete baseline relearn.
- Chrome 120 or newer
- Node.js and npm
- A Twitch account
- Your own registered Twitch developer application
Clone or download this repository, then run:
npm install
npm run buildThe unpacked extension is generated in dist/.
- Open
chrome://extensions. - Enable Developer mode.
- Select Load unpacked.
- Choose this project's
dist/directory. - Open the extension's options page and copy the displayed Twitch redirect URI.
The redirect URI has this form:
https://<extension-id>.chromiumapp.org/twitch
- Register a Twitch application and add the exact redirect URI shown by
inb4as an OAuth redirect URL. - Copy the application's Client ID.
- Replace
TWITCH_CLIENT_IDinsrc/shared/constants.tswith your Client ID. - Run
npm run buildagain. - Return to
chrome://extensionsand reloadinb4.
Twitch treats Client IDs as public identifiers, but each application should use its own. The Client ID in this repository belongs to the maintainer's application and will not authorize arbitrary unpacked-extension redirect URIs. This client-side extension does not need a Twitch client secret; never add one to the source code.
Open the options page, select Connect Twitch, approve the requested access, and add the channel logins you want to monitor.
Chat tracking requests the user:read:chat scope. Automatic clip creation is disabled by default and requests clips:edit only if you choose to enable it.
inb4 talks directly to Twitch and does not use a custom application server.
See the Privacy Policy for a complete description of the data the extension handles, how it is used, retention and deletion controls, and the parties involved in processing it.
The extension requests these Chrome permissions:
| Permission | Why it is needed |
|---|---|
identity |
Complete Twitch OAuth through Chrome's extension redirect flow. |
notifications |
Show desktop alerts when a chat spike is detected. |
storage |
Store authorization, settings, tracked channels, and notification state locally. |
alarms |
Recover EventSub connections and perform scheduled clip-related work under Manifest V3. |
Host access is limited to Twitch authentication, API, image, and EventSub endpoints declared in public/manifest.json.
The locally stored Twitch access token is sensitive. You can disconnect Twitch or use Clear local data from the options page to remove extension data from the current Chrome profile.
Distinct-chatter analysis is performed in service-worker memory. Raw chatter IDs and message text are not written to the detector checkpoint; the channel login, bucket counts, hashed message-deduplication tokens, coverage gaps, and detector state are kept in Chrome session storage. Session detector data is also removed by Clear local data.
Chrome Web Store privacy disclosures must remain consistent with the published Privacy Policy and the extension's current behavior.
# Rebuild into dist/ whenever source files change
npm run dev
# Type-check and create a production build
npm run build
# Run the unit test suite
npm test
# Run TypeScript checks only
npm run typecheck
# Replay an aggregate chronological detector trace
npm run replay:velocity -- fixtures/velocity-replay.example.jsonThe codebase uses TypeScript, Vite, Vitest, native DOM APIs, and Chrome extension APIs.
See Velocity replay for the aggregate trace format, privacy constraints, chronological evaluation contract, and interpretation of replay metrics.
GitHub Actions runs npm run typecheck, npm test, and npm run build for pull requests targeting master and for pushes to master.
Releases use Release Please and Conventional Commit semantics:
fix:proposes a PATCH release.feat:proposes a MINOR release.<type>!:or aBREAKING CHANGE:footer proposes a MAJOR release.
Release Please maintains a release pull request that synchronizes package.json, package-lock.json, .release-please-manifest.json, public/manifest.json, and this project's changelog. Merging that pull request creates a vMAJOR.MINOR.PATCH tag and GitHub Release. The release workflow builds the extension and attaches an inb4-MAJOR.MINOR.PATCH.zip containing the contents of dist/.
Chrome manifest versions must remain numeric. Prerelease labels and build metadata require a separate versioning scheme and are not currently supported by the automated release workflow. Publishing the ZIP to the Chrome Web Store remains a manual step.
.github/workflows/ CI and Release Please automation
src/background/ Twitch, EventSub, alarms, clips, and notifications
src/shared/ Shared types, storage, validation, and spike calculations
src/popup/ Toolbar popup
src/options/ Options page
src/ui/ Shared UI rendering and styles
public/ Manifest and extension icons
scripts/ Local detector replay commands
fixtures/ Aggregate replay examples and deterministic fixtures
docs/ Development and evaluation documentation
Build output in dist/ is generated and should not be edited by hand.
Licensed under the MIT License.
inb4 is an independent project and is not affiliated with or endorsed by Twitch.