Definition
push event (service worker)
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.
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.