Live notifications, deployment logs, stock tickers, AI responses streaming in token by token — none of these need a WebSocket. They're all one-directional: the server talks, the client listens. The browser has had a native protocol for exactly this since 2011 — Server-Sent Events (SSE) — and it runs over plain HTTP, passes through proxies and load balancers untouched, and reconnects automatically when the connection drops.

What SSE doesn't have is a good React story. The native EventSource API is imperative: you construct it, attach listeners, and must tear it down at exactly the right moment — the classic effect-lifecycle minefield. useEventSource from @reactuses/core turns the whole thing into declarative state: data, status, and error your component just renders. This post covers the hook's full API, the reconnect behavior that native EventSource gets subtly wrong, and useFetchEventSource — the fetch-based variant you'll need the moment your stream requires an Authorization header or a POST body, which in 2026 means every AI-completions endpoint.

Quick Start

npm install @reactuses/core

Enter fullscreen mode