Push API (Web Push)
Lets a server wake the site in the background and show a notification.
In one line
Can send you notifications after you leave, once you allow them
Lets a server wake the site in the background and show a notification.
Reaches the person after they leave the site. Every message must show a visible notification (userVisibleOnly), but the site learns when a device is online and which browser vendor push service it uses.
What it can and can't do
What the user does: You tap Allow on the notification pop up, or add the site to your iPhone Home Screen
It can
- Wake the site in the background and show a notification
- Send news, chat or order updates you asked for
- Learn when your device is online and which vendor's push service it uses
It cannot
- Send anything before you tap Allow
- Send a message without a visible notification
- Work on iPhone unless the site is a Home Screen web app
- Keep going once you block or unsubscribe
How it differs between platforms: On iPhone, only Home Screen web apps can receive push. Chrome, Edge, Firefox and Safari on computers ask with the same prompt.
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 42 | 2015-04-14 | None |
| Edge | Supported | 17 | 2018-04-30 | None |
| Firefox | Supported | 44 | 2016-01-26 | None |
| Safari | Supported | 16 | 2022-09-12 | macOS 13 Ventura Web Push, gesture required |
| Safari on iPhone | Supported | 16.4 | 2023-03-27 | Home Screen web apps only |
| Chrome on Android | Supported | 42 | 2015-04-15 | Needs showNotification on Android |
| Samsung Internet | Supported | 4.0 | 2016-03-11 | None |
How a site asks for it
| API | registration.pushManager.subscribe({userVisibleOnly: true, applicationServerKey}); push event; subscription.endpoint, getKey('p256dh'|'auth') |
| Permission name | push (plus notifications) |
| Browser compat keys | api.PushManagerapi.PushManager.subscribeapi.PushSubscriptionapi.PushEvent |
| How access is granted | prompt |
| What the user sees | Same notification prompt. subscribe() requires notifications permission first (Firefox and Safari also need a gesture). Safari on iOS only works for Home Screen web apps. |
| Needs a secure context (HTTPS) | Yes |
| Needs a user gesture | Yes |
| How long it lasts | Subscription persists until unsubscribe(), 404 or 410 from the endpoint, expiry, or clearing site data; permission revocation deletes it |
| How to take it back | Site settings, unsubscribe(), pushsubscriptionchange event, 410 Gone responses |
| Inside an iframe | Service worker scope only; iframes cannot subscribe |
Typical flow
- Register a service worker
- Request notification permission (gesture)
- pushManager.subscribe with the VAPID public key
- Send endpoint, p256dh and auth to your server
- Server POSTs an encrypted message (RFC 8291) with VAPID JWT (RFC 8292) to the vendor endpoint
- Browser wakes the service worker and fires push; the worker must call showNotification
Data you get
What comes back: Encrypted push message delivered to a service worker
Shape: event
How often: any time while the browser runs; delivered after restart within TTL
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
payload | binary | bytes | 0 to 4096 encrypted; about 4078 usable plaintext | 86 bytes overhead |
TTL | header | seconds | 0 to 2,419,200 (4 weeks FCM maximum); messages expire | 1 s |
Urgency | header | enum | very-low, low, normal, high | affects battery and delivery order |
Topic | header | string | up to 32 URL-safe base64 characters; replaces an undelivered message with the same topic | 32 chars |
VAPID public key | binary | bytes | 65-byte uncompressed P-256 point (87 base64url characters) | 65 bytes |
VAPID JWT exp | claim | seconds | up to 24 hours from issue | 1 s |
status codes | integer | HTTP | 201 created, 400 bad request, 404 or 410 gone, 413 payload too large, 429 slow down with Retry-After | per endpoint |
Technical limits
- Chrome and Safari require userVisibleOnly: true; hidden pushes are not allowed
- Payload about 4 KB maximum
- Firefox allows a limited number of silent pushes, quota resets when the site is visited
- Subscription endpoint is a capability URL: anyone holding it can send messages (with VAPID key)
- Browser closed on desktop means delivery waits until it reopens (within TTL)
The story
What it is
A site's server can wake your browser in the background and show a message when something new happens.
For you
You tap Allow on a prompt, then the site can send alerts any time, even if the tab is closed. Alerts look like those from apps. You can turn them off in browser settings.
For makers
Makers get a direct line to the person with no app store, no email and no ad cost. It is used for messages, news, sales and live events. The browser's own push service delivers the message.
Where you see it
| Type | Example | Apps |
|---|---|---|
| messaging | A web chat sends a push for each new message, so you reply even when the tab is closed. | WhatsApp Web, Slack |
| games | A browser strategy game pushes a note when an attack lands or your build ends. | None named |
| live | A sports site pushes a goal alert in the last minute of a match. | ESPN |
| shopping | A store pushes a flash sale or back in stock alert. | Etsy |
| news | A news site pushes breaking stories to subscribers. | The Washington Post |
| rideshare | A ride web app pushes your driver's arrival. | None named |
| ads | A push ad network buys placement in alerts, and may send false alert scams. | None named |
| banking | A bank pushes a card spend alert to confirm a payment is yours. | None named |
Risks
- Spam alerts
- Scam alerts
What the platform says
- MDN Web Docs: Push API. Lets a web app receive messages pushed from a server, even when the app is not loaded or running.
- WebKit: Web Push for iOS. Web apps added to the Home Screen can now receive push messages on iPhone and iPad, like native apps.
Good uses and abuse
Legitimate uses
- News alerts
- Chat messages
- Transactional updates
Known abuse
- Marketing spam
- Fake security alerts and scareware
- Tracking when a device is online
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 4 of 5 | How revealing the data is |
| Utility | 5 of 5 | How useful it is to honest apps |
| Friction | 2 of 5 | How much the user has to do |
| Fingerprint bits | 3 | Rough identifying entropy, when known |
History
- 2015-04, Chrome 42: Push API ships with GCM, later FCM
- 2016-01, Firefox 44: Push API ships (Mozilla autopush)
- 2018-09, Chrome 70: VAPID required for new FCM subscriptions in Chrome
- 2020-01, Firefox 72: Gesture required for notification prompt
- 2022-09, Safari 16: Web Push on macOS via web.push.apple.com, standards based VAPID
- 2023-03, Safari on iPhone 16.4: Web Push on Home Screen web apps
- 2025-03, Safari on iPhone 18.4: Declarative Web Push (JSON payload with web_push 8030)
Related capabilities
Related
- Notifications. Can show messages on your screen outside the browser tab, once you tap Allow
- Declarative Web Push (Safari). Can show you a notification from Safari's new push format without running site code
- Chrome and OS defenses against notification abuse. Can't keep sending spam if you block it; Chrome quiets and removes abusers
Sources
- MDN Push API
- W3C Push API
- RFC 8030 Generic Event Delivery Using HTTP Push
- RFC 8291 Message Encryption for Web Push
- RFC 8292 VAPID
How well checked: Based on official documentation.