Add push notifications

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

Categories: push notifications, alerts, engagement, retention

Tools that power the Add push notifications stack

Setup guide

  1. OneSignal: Choose one push provider. For OneSignal web push, follow its web setup guide for your site platform: configure HTTPS, install the SDK and service worker, and request permission after explaining the benefit and a user interaction. Test subscription and delivery in each supported browser before sending a campaign. (Read official instructions)
  2. Firebase Cloud Messaging: For Firebase Cloud Messaging web push, follow the setup guide for the SDK version you install. The current guide recommends register and onRegistered with Firebase Installation IDs (FIDs); legacy getToken examples use registration tokens and are not interchangeable. Configure the messaging service worker and VAPID key, request permission, and bind the registered identifier to the authenticated user on your server. Use the matching server send flow, handle invalid registrations, and test delivery before rollout. (Read official instructions)
  3. Pusher Beams: For private user notifications with Pusher Beams, use Authenticated Users. Implement a server token endpoint that checks the signed-in user before issuing a Beams token for that same user ID, then use the SDK TokenProvider and setUserId flow. Publish to authenticated users from your server. Device interests are for anonymous groups, not access control; test that a second account cannot subscribe as the first. (Read official instructions)
  4. Web Push API: For a custom Web Push implementation, generate VAPID keys on the server and keep the private key secret. Register a service worker and request permission following a user gesture. Send the resulting PushSubscription to an authenticated server endpoint, then use web-push.sendNotification from the server. Browser push services still deliver messages; handle expired subscriptions and test supported browsers. (Open Web Push API instructions)

    Check: For the chosen provider, an opted-in test device receives one notification, revoked or expired subscriptions are handled, and private delivery cannot be redirected to another user.