Skip to Content
Platform.Ontology

Push API (Web Push)

Lets a server wake the site in the background and show a notification.

Asks you firstNotifications and backgroundPushWeb browsersAfter you leave the site

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

BrowserStatusFirst versionReleasedNote
ChromeSupported422015-04-14None
EdgeSupported172018-04-30None
FirefoxSupported442016-01-26None
SafariSupported162022-09-12macOS 13 Ventura Web Push, gesture required
Safari on iPhoneSupported16.42023-03-27Home Screen web apps only
Chrome on AndroidSupported422015-04-15Needs showNotification on Android
Samsung InternetSupported4.02016-03-11None

How a site asks for it

APIregistration.pushManager.subscribe({userVisibleOnly: true, applicationServerKey}); push event; subscription.endpoint, getKey('p256dh'|'auth')
Permission namepush (plus notifications)
Browser compat keysapi.PushManager
api.PushManager.subscribe
api.PushSubscription
api.PushEvent
How access is grantedprompt
What the user seesSame 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 gestureYes
How long it lastsSubscription persists until unsubscribe(), 404 or 410 from the endpoint, expiry, or clearing site data; permission revocation deletes it
How to take it backSite settings, unsubscribe(), pushsubscriptionchange event, 410 Gone responses
Inside an iframeService worker scope only; iframes cannot subscribe

Typical flow

  1. Register a service worker
  2. Request notification permission (gesture)
  3. pushManager.subscribe with the VAPID public key
  4. Send endpoint, p256dh and auth to your server
  5. Server POSTs an encrypted message (RFC 8291) with VAPID JWT (RFC 8292) to the vendor endpoint
  6. 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

FieldTypeUnitRangePrecision
payloadbinarybytes0 to 4096 encrypted; about 4078 usable plaintext86 bytes overhead
TTLheaderseconds0 to 2,419,200 (4 weeks FCM maximum); messages expire1 s
Urgencyheaderenumvery-low, low, normal, highaffects battery and delivery order
Topicheaderstringup to 32 URL-safe base64 characters; replaces an undelivered message with the same topic32 chars
VAPID public keybinarybytes65-byte uncompressed P-256 point (87 base64url characters)65 bytes
VAPID JWT expclaimsecondsup to 24 hours from issue1 s
status codesintegerHTTP201 created, 400 bad request, 404 or 410 gone, 413 payload too large, 429 slow down with Retry-Afterper 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

TypeExampleApps
messagingA web chat sends a push for each new message, so you reply even when the tab is closed.WhatsApp Web, Slack
gamesA browser strategy game pushes a note when an attack lands or your build ends.None named
liveA sports site pushes a goal alert in the last minute of a match.ESPN
shoppingA store pushes a flash sale or back in stock alert.Etsy
newsA news site pushes breaking stories to subscribers.The Washington Post
rideshareA ride web app pushes your driver's arrival.None named
adsA push ad network buys placement in alerts, and may send false alert scams.None named
bankingA 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

ScoreValueMeaning
Sensitivity4 of 5How revealing the data is
Utility5 of 5How useful it is to honest apps
Friction2 of 5How much the user has to do
Fingerprint bits3Rough 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)

Sources

How well checked: Based on official documentation.

On this page