streaming-api-patterns

Stream real-time data using SSE, WebSockets, and the Streams API.

3|Updated Dec 27, 2025
One-click install
npx skills add https://github.com/yonatangross/create-yg-app --skill streaming-api-patterns-yonatangross
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: streaming-api-patterns
Source: https://github.com/yonatangross/create-yg-app/tree/main/.claude/skills/streaming-api-patterns
Command: npx skills add https://github.com/yonatangross/create-yg-app --skill streaming-api-patterns-yonatangross

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Stream real-time data from server to client using SSE, WebSockets, and the Streams API. This skill provides patterns and examples to enable low-latency LLM streaming and live updates for modern web applications.

Core Features & Use Cases

  • SSE for server-to-client streaming (progress updates, live feeds)
  • WebSockets for bidirectional communication (chat, collaboration)
  • ReadableStream-based backpressure and chunking for large data
  • LLM streaming patterns for token-by-token UX
  • Production considerations: reconnection strategies, buffering, and error handling

Quick Start

Configure a streaming endpoint (SSE and WebSocket) and consume via a browser EventSource or WebSocket client to observe real-time updates.

Frequently Asked Questions about streaming-api-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement LLM streaming for a token-by-token chat UI?

LLM streaming for chat UIs is implemented using SSE or WebSockets to push token-by-token updates from server to client. Patterns include ReadableStream chunking and backpressure handling to maintain low-latency delivery.

What is the best way to handle backpressure in a real-time streaming API?

Backpressure in a streaming API is handled using ReadableStream-based chunking to manage data flow. This approach prevents memory overload by pausing data production when the client cannot consume incoming chunks fast enough.

When should I use SSE vs WebSockets for live updates?

Use SSE for server-to-client live updates like progress tracking and feeds, requiring only an EventSource client. Use WebSockets when you need bidirectional communication for real-time chat or collaborative workflows.

How do I implement reconnection strategies for server-sent events?

Reconnection strategies for server-sent events are implemented using production patterns that include buffering and error handling. These ensure the EventSource client automatically recovers and resumes the live data stream after a dropped connection.

Can I use the Streams API to stream large data chunks to a browser?

Yes, the Streams API enables streaming large data chunks to a browser via ReadableStream. This method provides backpressure-aware data flow, ensuring efficient delivery without overwhelming the client's memory capacity.