Overview

The Push API enables servers to send data to a Service Worker. This is the foundation for web-based push notifications. It works in conjunction with the Notifications API, which is used to actually display the message to the user.

How it Works

  1. Subscription: The user grants permission, and the browser generates a unique endpoint.
  2. Push: The server sends a message to that endpoint via a push service.
  3. Wake up: The browser wakes up the Service Worker to handle the incoming message.

Use Cases

  • Real-time alerts and news updates.
  • Chat message notifications.
  • Re-engaging users with personalized content.

Related Terms