Send web push notifications from a website

8 steps · about 2 h 15 min · Intermediate

  1. See how web push works end to end (article, web.dev, 15 min)

    Maps the browser, push service and your server in one diagram.

  2. Learn the Push API surface (reference, MDN, 15 min)

    Names the objects you will call: PushManager, PushSubscription, push events.

  3. Request permission and show a notification (tutorial, MDN, 20 min)

    Covers asking at the right moment and what users see.

  4. Subscribe a user and store the subscription (tutorial, web.dev, 20 min)

    Walks through the subscribe call and sending it to your backend.

  5. Understand the Web Push protocol and VAPID (article, web.dev, 20 min)

    Explains the signed, encrypted request your server sends.

  6. Check the VAPID specification (reference, IETF, 15 min)

    The standard behind the application server keys you generate.

  7. Send pushes from Node.js with web-push (repo, GitHub, 15 min)

    A maintained library that handles keys and encryption for you.

  8. Make push work in Safari and on iOS (article, Apple Developer, 15 min)

    Lists Apple's extra rules, such as home screen web apps on iOS.