Skip to content

Add push notifications

Bring users back with a tap. Web and mobile push, set up and sending.

  1. 1
    OneSignal

    Sign up for OneSignal and create a new Web Push app. Add the OneSignal SDK snippet to your site's <head>. OneSignal will automatically prompt visitors to subscribe. Segment subscribers by behavior in the OneSignal dashboard to send targeted re-engagement messages.

    Open OneSignal
  2. 2
    Firebase Cloud Messaging

    In the Firebase Console, create a project and enable Cloud Messaging. Install the firebase npm package and initialize it with your config object. Call getToken() to retrieve the device token, save it to your database, and use the Admin SDK on your server to push messages to individual tokens or topics.

    Open Firebase Cloud Messaging
  3. 3
    Pusher Beams

    Sign up for Pusher Beams and create a new instance. Install the @pusher/push-notifications-web SDK. Call beamsClient.start() and subscribe the user to an interest matching their user ID. From your backend, call the Beams Publish API to push to that interest whenever a relevant event occurs.

    Open Pusher Beams
  4. 4
    Web Push API

    Generate VAPID keys with the web-push npm library. Register a service worker that listens for push events and calls self.registration.showNotification(). On subscription, send the PushSubscription object to your server and use web-push.sendNotification() to deliver messages without any third-party dependency.

    Open Web Push API

Know a better stack?

Share your favourite tool combination with the community.

Suggest a stack