sse
Installation
SKILL.md
Server-Sent Events (SSE)
SSE allow a web page to get updates from a server. Unlike WebSockets, SSEs are unidirectional (Server -> Client) and use standard HTTP.
When to Use
- Unidirectional Real-Time Streaming: Pushing server updates to web browsers without requiring the overhead of bidirectional WebSockets.
- LLM Token Streaming: Delivering incremental token completions from OpenAI/Anthropic/vLLM models to frontend chat interfaces.
- Live Activity Feeds & Dashboards: Pushing live sport scores, stock tickers, system metrics, and notification counts.
- Native HTTP/2 Multiplexing: Benefiting from standard HTTP infrastructure, firewalls, load balancers, and authentication headers.
Quick Start
// Client
const evtSource = new EventSource("/api/events");