Agent skill · software engineering · aiskillstore

streaming-api-patterns

Implement real-time data streaming with Server-Sent Events (SSE), WebSockets, and ReadableStream APIs. Master backpressure handling, reconnection strategies, and LLM streaming for 2025+ real-time applications.

Why this skill is useful

Provides specific implementation patterns for real-time data streaming using SSE, WebSockets, and ReadableStream APIs that are not widely documented.

What it needs

About 3k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.

What this skill does

Streaming API Patterns Overview Modern applications require real-time data delivery. This skill covers Server-Sent Events (SSE) for server-to-client streaming, WebSockets for bidirectional communication, and the Streams API for handling backpressure and efficient data flow. When to use this skill: Streaming LLM responses (ChatGPT-style interfaces) Real-time notifications and updates Live data feeds (stock prices, analytics) Chat applications Progress updates for long-running tasks Collaborative editing features Core Technologies 1. Server-Sent Events (SSE) Best for: Server-to-client streaming (LLM responses, notifications) 2. WebSockets Best for: Bidirectional real-time communication (chat, collaboration) 3. ReadableStream API Best for: Processing large data streams with backpressure LLM Streaming Pattern Reconnection Strategy Best Practices SSE ✅ Use for one-way server-to-client streaming ✅ Implement automatic reconnection ✅ Send keepalive messages every 30s ✅ Handle browser connection limits (6 per domain) ✅ Use HTTP/2 for better performance WebSockets ✅ Use for bidirectional real-time communication ✅ Implement heartbeat/ping-pong ✅ Handle reconnection with exponential backoff ✅ Validate and sanitize messages ✅ Implement message queuing for offline periods Backpressure ✅ Use ReadableStream with proper flow control ✅ Monitor buffer sizes ✅ Pause production when consumer is slow ✅ Implement timeouts for slow consumers Performance ✅ Compress data (gzip/brotli) ✅ Batch small messages ✅ Use binary formats (MessagePack, Protobuf) for large data ✅ Implement client-side buffering ✅ Monitor connection count and resource usage Resources Server-Sent Events Specification WebSocket Protocol Streams API Vercel AI SDK

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aiskillstore/streaming-api-patterns

View the source on GitHub

Browse the @skills marketplace