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
- Live Feeds: News tickers, Sport scores, Stock prices.
- Progress Updates: "Processing Import: 45%...", Logging streams.
- Notifications: In-app alerts where the user doesn't need to reply instantly via the same channel.
- Replacement for Polling: More efficient than asking "Are we there yet?" every second.
Quick Start
// Client
const evtSource = new EventSource("/api/events");