The pushsubscriptionchange event fires in your service worker when the browser changes, renews or loses a web push subscription. Handle it by subscribing again if needed, then sending the new subscription to your server and removing the old endpoint. Chrome supports it from version 138; Firefox and Safari also fire it.
Most web push tutorials skip this event, and that’s how sites quietly lose subscribers. If the browser rotates a subscription and your server never hears about it, you keep sending to a dead endpoint until it returns 410 Gone. Here’s what the pushsubscriptionchange event is, when it fires, and the handler I’d use in 2026.
Key facts at a glance:
- Where it fires: in the service worker (ServiceWorkerGlobalScope), not on the page.
- What it carries: a PushSubscriptionChangeEvent with oldSubscription and newSubscription properties, either of which can be null.
- Support (MDN data, November 2026): Chrome and Chromium browsers 138+, Firefox 44+ (old and new subscription properties from Firefox 137), Safari 16+ on macOS.
- Spec: defined in the W3C Push API.
- Not a full safety net: it may not fire for every change, so pair it with a check on each page visit.
What is the pushsubscriptionchange event?
The pushsubscriptionchange event is the browser’s way of telling your service worker that the push subscription it knew about is no longer valid. It’s the only signal you get while the visitor isn’t on your site.
A web push subscription is a pairing of an endpoint URL at the push service and a set of encryption keys. The browser can replace that pairing on its own. When it does, the old endpoint stops working. If your server still stores it, every message you send to that subscriber fails.
When does the pushsubscriptionchange event fire?
It fires when the push service or browser expires, refreshes or invalidates a subscription. The exact triggers differ between browsers, which is why the spec leaves room for each one.
Common situations include:
- The subscription reached an expiration time set by the push service.
- The browser refreshed the subscription’s keys or endpoint.
- The push service invalidated the subscription and the browser created a new one.
- The browser lost the subscription because of a data or profile change.
Don’t rely on it when a visitor blocks notifications in site settings. Behaviour varies by browser, and with permission gone your handler can’t subscribe again anyway. Your server finds out through a 404 or 410 response the next time it sends. My post on the web push 410 Gone error covers that cleanup.
Which browsers support pushsubscriptionchange?
All major desktop engines fire it now, but support arrived at different times. Chrome was the last big holdout and added it in version 138 in 2025.
| Browser | pushsubscriptionchange event | oldSubscription / newSubscription | Notes (MDN data, November 2026) |
|---|---|---|---|
| Chrome, Edge (Chromium), Opera | 138+ | 138+ | Desktop and Android |
| Firefox | 44+ | 137+ | Before 137, the event had no subscription properties |
| Safari on macOS | 16+ | 16+ | macOS Ventura and later |
| Safari on iOS and iPadOS | Inconsistent data | Inconsistent data | Home Screen web apps only; test on a device |
The data comes from MDN’s pushsubscriptionchange page and its compatibility tables. Because older browser versions are still in use, write your handler so it works even when the properties are missing.
How do you handle the pushsubscriptionchange event?
Handle it in three steps: get a valid new subscription, send it to your server with the old endpoint, and let the server swap them. Wrap the work in event.waitUntil() so the browser keeps the service worker alive until it finishes.
// sw.js
const VAPID_PUBLIC_KEY = 'YOUR_PUBLIC_KEY_BASE64URL';
self.addEventListener('pushsubscriptionchange', (event) => {
event.waitUntil((async () => {
const oldEndpoint = event.oldSubscription ? event.oldSubscription.endpoint : null;
let sub = event.newSubscription;
if (!sub) {
// Older browsers: subscribe again with the same VAPID key
sub = await self.registration.pushManager.subscribe({
userVisibleOnly: true,
applicationServerKey: VAPID_PUBLIC_KEY
});
}
await fetch('/api/push/resubscribe', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ oldEndpoint, subscription: sub.toJSON() })
});
})());
});On the server, find the row with the old endpoint, replace the endpoint and keys, and keep the subscriber’s tags and segments. If oldEndpoint is null, treat it as a new subscription. For the widest browser support, convert the Base64URL key to a Uint8Array before passing it as the applicationServerKey.
What can go wrong in the handler?
Most failures come from three places: missing data, permission and authentication. Plan for each one.
- No old subscription. In some browsers oldSubscription is null, so you can’t match the old row. Store a first-party subscriber ID in IndexedDB and send it with the request.
- Permission is gone. If notifications were blocked, pushManager.subscribe() throws. Catch the error and stop; don’t loop.
- No cookies. A service worker request may not carry a logged-in session. Make the endpoint accept the old endpoint or a stored ID instead of requiring a login.
- Different VAPID key. Subscribing again with a new key creates subscriptions that your server can’t send to. Keep the same key, as I explain in VAPID keys for web push.
Is pushsubscriptionchange enough on its own?
No. The event may not fire in every case, and older browser versions might not fire it at all. So I always add a second check: re-sync the subscription whenever the visitor opens your site.
On each page load, call registration.pushManager.getSubscription(). If it returns a subscription, send the endpoint and keys to your server, which updates the row if anything changed. If it returns null but permission is still granted, subscribe again quietly. This catches changes the event missed, and it costs one small request per visit.
Together, the event and the page-load check keep your list close to reality. For a wider look at subscription lifespan, read how long web push subscriptions last, and for the service worker basics see my guide to the service worker for web push.
Where LaraPush fits
If you use a push panel, check that its service worker keeps subscriptions in sync, because that’s where this logic lives. LaraPush is a self-hosted web push panel that you install on your own VPS, with a one-time licence from $499 (check LaraPush pricing). It provides the service worker and JavaScript for your site, sends through Firebase Cloud Messaging, and keeps subscriber data on your server. The setup guide covers installation. The trade-offs are no free plan and a server you maintain. For other options, see my roundup of the best push notification services and tools.
Frequently asked questions
Don’t count on it. Behaviour varies by browser, and your handler can’t subscribe again without permission anyway. Your server reliably finds out when the push service returns 404 or 410 on the next send. Delete the subscription at that point. If the visitor allows notifications again later, your page-load check creates and saves a new subscription.
Testing is awkward, because you can’t make most browsers rotate a subscription on demand. A practical approach is to extract the handler body into a function, then call it from the page or DevTools console with a fake old endpoint. Check that your server swaps the row correctly and keeps the subscriber’s segments.
Some browsers, and older versions of others, fire the event without a new subscription. They expect your service worker to call pushManager.subscribe() again. Do that with the same VAPID public key, then send the result to your server. If subscribing fails, permission is probably gone, so stop there.
Yes, once your server has saved the new subscription. Replace the old row instead of inserting a second one, so the subscriber doesn’t get duplicate notifications and your counts stay accurate. If you can’t match the old endpoint, the 404 or 410 cleanup on the next send removes it.
Partly. The Firebase JavaScript SDK refreshes its registration token from the page, and your code should send the latest token to your server whenever getToken() returns it. If you use FCM through your own service worker, keep the page-load re-sync in place so token changes still reach your database.




