cid a7ecb1c5ff3201248b2028d9eb871e075629fa87dfdb717bb80bd81c9e7f7c77 · original · open access · via mdn
Title: Server-sent events - Web APIs | MDN Authors: Venue: mdn Year: 2026 Canonical: mdn:Web/API/Server-sent_events URL: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events Collector: mdn OA: true ABSTRACT Server-sent events - Web APIs | MDN Skip to main content Skip to search Server-sent events Note: This feature is available in Web Workers. Traditionally, a web page has to send a request to the server to receive new data; that is, the page requests data from the server. With server-sent events, it's possible for a server to send new data to a web page at any time, by pushing messages to the web page. These incoming messages can be treated as Events + data inside the web page. Concepts and usage To learn how to use server-sent events, see our article Using server-sent events. Interfaces EventSource Defines all the features that handle connecting to a server, receiving events/data, errors, closing a connection, etc. Examples Simple SSE demo using PHP Specifications Specification HTML # server-sent-events See also Tools Mercure: a real-time communication protocol (publish-subscribe) built on top of SSE Transmit: a native opinionated Server-Sent-Event (SSE) module built for AdonisJS EventSource polyfill for Node.js intercooler.js declarative SSE support Related Topics Learn: Making network requests with JavaScript JavaScript WebSockets Other resources Creating a wall/feed social application powered by server-sent events and its code on GitHub. Help improve MDN Was this page helpful to you? Yes No Learn how to contribute This page was last modified on Oct 10, 2026 by MDN contributors. View this page on GitHub • Report a problem with this content