Glossary

Definition

push event (service worker)

Short definition

The push event fires on the service worker whenever a message arrives from the push service the browser is subscribed to. A handler typically reads event.data.json() for the payload and calls event.waitUntil(self.registration.showNotification(title, options)) so the browser keeps the worker alive until the notification is actually displayed.

Reviewed August 3, 2026

Example: self.addEventListener("push", (event) => { const data = event.data ? event.data.json() : {}; event.waitUntil(self.registration.showNotification(data.title ?? "Update", { body: data.body, icon: "/icon-192.png", badge: "/badge-72.png" })); });.

On Chromium browsers, the userVisibleOnly policy means failing to show a visible notification in response to a push event can eventually cause the browser to show its own generic "This site has been updated in the background" notification, or restrict future silent pushes — always call showNotification() in the handler.

The event.data payload is limited in size (4KB is a commonly cited practical ceiling across push services) and is delivered already decrypted to your service worker by the browser, even though it travelled encrypted over the network.

A related pushsubscriptionchange event fires when the browser silently renews an expiring subscription; production apps should listen for it and re-send the new subscription to the server, or risk losing that user silently.

Related terms
Push API
The Push API lets a service worker subscribe to a browser-run push service and receive encrypted messages from a server at any time, including when no tab or window for the site is open. Subscribing is done with registration.pushManager.subscribe({ userVisibleOnly: true, applicationServerKey }), and incoming messages arrive in the worker's push event.
PushSubscription
A PushSubscription is the object returned by pushManager.subscribe(), containing an endpoint (a unique, vendor-hosted URL that identifies this specific device/browser installation) and a keys object with p256dh and auth values used to encrypt messages sent to it. Your server stores this per user and sends future notifications by POSTing an encrypted payload to subscription.endpoint.
Notification permission states
Notification.permission returns one of three strings: "default" (the user has not yet decided, so the site may still call Notification.requestPermission() to ask), "granted" (the site may show notifications), or "denied" (the site is blocked from showing notifications and, critically, cannot re-prompt programmatically once denied).
badge (Notification option)
badge is a field passed to showNotification(title, { badge: "/badge-72.png", ... }) that supplies a small, typically monochrome PNG icon (recommended around 72x72 or 96x96) shown in the Android status bar and shade, as distinct from the larger icon field used for the main notification image.
actions (Notification option)
actions is an array option passed to showNotification(), e.g. { actions: [{ action: "reply", title: "Reply" }, { action: "dismiss", title: "Dismiss" }] }, that renders extra buttons on the notification itself. The service worker's notificationclick handler reads event.action to see which button, if any, the user pressed.
tag (Notification option)
tag is a string option, e.g. showNotification("New message", { tag: "chat-thread-42" }), used to identify a class of related notifications. When a new notification arrives with a tag matching one already showing, the browser replaces it in place by default rather than adding a second, separate notification to the shade.