web-realtime-sse

Installation
SKILL.md

Server-Sent Events (SSE) Patterns

Quick Guide: SSE pushes text from server to client over an ordinary HTTP response, so it crosses proxies and firewalls that block anything more exotic. EventSource gives reconnection and Last-Event-ID replay for free but is GET-only and cannot set headers; fetch streaming gives up both and buys custom headers, POST bodies and an AbortController. The facts that change the answer: EventSource retries network errors but gives up permanently on an HTTP error status, retry: is milliseconds, and Connection: keep-alive is prohibited on HTTP/2+.

Detailed Resources:

  • examples/core.md — EventSource lifecycle, named events, credentials, a state-tracking wrapper, typed messages, and the React hooks built on them
  • examples/fetch-streaming.md — stream reader with buffer handling, field parser, auth headers, POST streaming, token-by-token UI
  • examples/reconnection.mdLast-Event-ID recovery, exponential backoff, health checks, visibility-aware pausing
  • reference.md — message format, field behaviour, readyState values, required response headers, EventSource behaviour table

Which path applies

  • EventSource — the browser reconnects, replays through Last-Event-ID and parses the wire format for you. It sends GET only, sets no headers, and authenticates by cookie (withCredentials: true). Start at examples/core.md.
  • Fetch streaming — reach for it when the stream needs an Authorization header, a POST body, or cancellation you control. You then own reconnection, backoff, Last-Event-ID and the field parsing. See examples/fetch-streaming.md.

Both consume the same wire format, so the parser and the message types are shared between them.

Installs
36
GitHub Stars
24
First Seen
Mar 1, 2026
web-realtime-sse — agents-inc/skills