flamefront-end/sse-runtime — explained in plain English
Analysis updated 2026-05-18
Stream server updates to a protected API that requires an authorization header.
Automatically refresh an expired auth token and retry when a stream request gets a 401.
Share a single live server connection across multiple browser tabs of the same page.
Connect to a real-time event stream from a React or React Native app with automatic cleanup.
| flamefront-end/sse-runtime | 5bv57zcm44-max/noxus-ai-open-whatsapp | adrianhajdin/react-native-lingua | |
|---|---|---|---|
| Stars | 27 | 27 | 27 |
| Language | TypeScript | TypeScript | TypeScript |
| Setup difficulty | easy | moderate | moderate |
| Complexity | 3/5 | 4/5 | 3/5 |
| Audience | developer | developer | vibe coder |
Figures from each repo's GitHub metadata at analysis time.
Multi-tab connection sharing needs BroadcastChannel and the Web Locks API, falling back to independent connections otherwise.
This library fills gaps in the browser's built-in way of receiving a continuous stream of updates from a server. That built-in mechanism, called EventSource, has a well-known set of problems: it cannot send an authorization header, so it cannot be used with protected APIs that require a token. The data it delivers is untyped, meaning code that reads it has no idea what shape the data will be. Its reconnection behavior cannot be configured. And when a user opens the same page in multiple tabs, each tab opens its own separate connection to the server. sse-runtime replaces EventSource with a fetch-based implementation that addresses each of these problems. It sends custom headers including authorization tokens, and supports a hook that can refresh an expired token and retry automatically when a 401 response arrives. Event types and their data shapes are declared once, and the library enforces those types throughout so that handler code knows exactly what it is receiving. Reconnection uses a jittered delay that increases after each failure, with a configurable maximum number of retries and a way to classify specific error codes differently. For the multi-tab problem, it uses browser coordination tools to share a single real connection across all tabs showing the same page, with automatic handoff if the coordinating tab closes. The library is split into four packages. The core package has no framework dependency and can be used in any JavaScript environment. A React package wraps the core in a hook that connects when a component mounts and disconnects when it unmounts, keeping event handlers current without tearing down the connection. A React Native package provides lifecycle helpers for mobile apps. A devtools package adds a panel for inspecting live connections and event logs during development. Browser support requires fetch, ReadableStream, AbortController, and TextDecoder, which are available in all modern browsers. The multi-tab coordination feature additionally requires BroadcastChannel and the Web Locks API, and falls back to independent per-tab connections when those are not available. The project is MIT licensed.
sse-runtime is a fetch-based replacement for the browser's EventSource that adds auth headers, typed events, configurable reconnection, and multi-tab connection sharing.
Mainly TypeScript. The stack also includes TypeScript, React, React Native.
MIT license: free to use, modify, and distribute, including commercially, with attribution.
Setup difficulty is rated easy, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.