server-sent-events

Stream server-to-client progress updates via Server-Sent Events in Next.js apps.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/vuthuonghai-steve/KLTN --skill server-sent-events-vuthuonghai-steve
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: server-sent-events
Source: https://github.com/vuthuonghai-steve/KLTN/tree/main/.cursor/commands/server-sent-events
Command: npx skills add https://github.com/vuthuonghai-steve/KLTN --skill server-sent-events-vuthuonghai-steve

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

SSE enables real-time, server-to-client progress streaming for web applications, eliminating polling delays and enabling live dashboards.

Core Features & Use Cases

  • Server endpoint that streams progress data via text/event-stream.
  • Client-side consumption with EventSource or streaming fetch to render live updates and progress bars.
  • Suitable for long-running tasks, live dashboards, and multi-step workflows across modern Next.js deployments.

Quick Start

Start a server-sent events stream from an API endpoint and render progress updates on the client.

Frequently Asked Questions about server-sent-events

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

FAQPage Schema
How do I stream real-time progress updates from a Next.js server to a client?

You can stream real-time progress updates by implementing an SSE endpoint using the text/event-stream content type and consuming it on the client via EventSource or a streaming fetch. This enables unidirectional server-to-client live data streaming.

When should I use server-sent events instead of polling for live dashboards?

Server-sent events are ideal for live dashboards because they eliminate polling delays by maintaining a persistent HTTP connection for continuous unidirectional streaming. This approach provides immediate progress tracking for long-running tasks without repeated client requests.

Does server-sent events work with Next.js deployments on Vercel?

Yes, implementing server-sent events works with Next.js deployments on Vercel by applying host-agnostic considerations. The implementation includes robust error handling and lifecycle management to ensure stable streaming across modern serverless and edge environments.

What is the best way to handle SSE error handling and connection lifecycle in a web app?

The best way to handle SSE error management is to implement robust lifecycle controls within your EventSource or streaming fetch client. This ensures proper connection closure, error recovery, and stable unidirectional streaming for live progress updates.

Can I use EventSource to consume text/event-stream data for multi-step workflows?

Yes, you can use the browser's EventSource API or a streaming fetch to consume text/event-stream data. This is highly suitable for rendering live updates and progress bars during multi-step workflows and long-running server tasks.

Why do my server-sent events stop streaming during long-running tasks?

Server-sent events may stop streaming during long-running tasks due to platform timeouts or dropped connections. Implementing robust error handling, connection lifecycle management, and host-agnostic configurations helps maintain stable real-time progress updates.