sse-streaming

Stream Server-Sent Events from Cloudflare Workers to browser clients.

3|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/paolomoz/skills --skill sse-streaming-paolomoz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sse-streaming
Source: https://github.com/paolomoz/skills/tree/main/skills/sse-streaming
Command: npx skills add https://github.com/paolomoz/skills --skill sse-streaming-paolomoz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill enables seamless real-time data flow from a server to a browser, ensuring users see updates instantly without manual refreshes, crucial for dynamic applications.

Core Features & Use Cases

  • Server-Sent Events (SSE): Implements robust SSE for pushing data from Cloudflare Workers.
  • Client-Side Handling: Provides client-side logic for consuming events, rendering content, and managing state.
  • Resilience: Includes automatic reconnection with exponential backoff and state persistence via sessionStorage.
  • Use Case: Stream AI-generated content block-by-block to a web page as it's created, showing progress and partial results immediately.

Quick Start

Use the sse-streaming skill to implement a real-time progress indicator for a long-running server task.

Frequently Asked Questions about sse-streaming

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

FAQPage Schema
How do I stream real-time data from Cloudflare Workers to a browser?

Server-Sent Events (SSE) streaming from Cloudflare Workers pushes real-time data to browsers using TransformStream for server-side emission and EventSource for client-side consumption. This allows dynamic updates without manual refreshes.

Does Cloudflare Workers support Server-Sent Events for real-time updates?

Cloudflare Workers support Server-Sent Events by implementing server-side event emission using TransformStream. This approach enables pushing real-time data updates to browser clients instantly as server-side processes generate new information.

How do I handle SSE reconnection logic with exponential backoff in the browser?

SSE reconnection logic with exponential backoff is handled client-side using EventSource and sessionStorage. This ensures automatic reconnection to the Cloudflare Worker stream while persisting state across page reloads.

What is the best way to stream AI-generated content to a web page as it is created?

Streaming AI-generated content block-by-block to a web page is achieved using Server-Sent Events from Cloudflare Workers. This approach renders skeleton templates for immediate UI feedback and displays partial results as they are generated.

Server-Sent Events vs Web Sockets for real-time streaming from edge workers?

Server-Sent Events provide unidirectional real-time streaming from server to browser, which is simpler than Web Sockets for tasks like pushing updates. This approach uses standard HTTP and includes automatic reconnection logic with exponential backoff.