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

Frequently asked questions

Costs depend on your scale. Most tools in this stack offer a free tier to start. Open the cost calculator on this page to estimate monthly cost based on your users and revenue.

This stack uses 4 tools: OneSignal, Firebase Cloud Messaging, Pusher Beams, Web Push API. Each tool is picked to work well with the others and to cover a specific part of the workflow.

Yes. The stack is a recommended starting point. You can replace any tool with an alternative you already use. Check the setup guide first to confirm the integration points you'll need to rebuild.

Most makers finish the 4-step setup in under an hour. Creating accounts and connecting the first integration takes the most time.

Have a better stack?

Share your favorite tool combination and help other builders.

Suggest a stack