Push notifications are a powerful way to deliver real-time updates, reminders, and personalized messages to your users across mobile and web platforms. Whether it’s a promotional alert, a system notification, or a critical update, push notifications are key to enhancing engagement and retention.

Novu simplifies the process by offering a unified API that supports multiple push notification providers, enabling reliable and efficient message delivery.

Key Features

  • Multi-Provider Support: Integrate with providers like Firebase Cloud Messaging (FCM), OneSignal, or Apple Push Notification Service (APNS)
  • Unified Delivery: Streamline your push notifications with a single API for mobile and web platforms
  • Dynamic Content: Customize notifications with variables for personalized user experiences
  • Device Management: Keep subscriber device tokens in sync using just-in-time or manual updates

Common Use Cases

  • Transactional Notifications: Payment updates, delivery alerts, appointment reminders
  • Engagement Notifications: Promotions, re-engagement campaigns, social media interactions
  • System Alerts: Security warnings, downtime alerts, account activity updates

How to send push notifications

To send a push notification to subscribers (users) using Novu:

  • Add a push channel provider in integration store
  • Add push channel as a step in existing or new workflow.
  • Add static or dynamic content using variables in push step fields
  • Store provider specific device tokens/identifiers in subscriber profile. Read provider specific documentation on how to obtain and store device tokens.
  • Make sure all provider specific steps are configured properly before triggering workflow. Read provider related documentation for all required steps.
  • Trigger the workflow.

Supported providers

Novu supports multiple active providers for push channel.

Managing push device tokens

To send push notifications to subscribers, you need to store device tokens or identifiers in subscriber profiles. These tokens are unique identifiers that help push notification providers deliver messages to the correct devices. Each provider has its own method for obtaining and storing device tokens.

Novu offers to ways of keeping your device tokens in sync with subscriber profiles:

  • Just-in-time: Pass device tokens in the payload when triggering a workflow. Novu will automatically update subscriber profiles with the new device tokens.
  • Manual: Update subscriber profiles with device tokens using the Novu Set Credentials API.

Just-in-time

When triggering a workflow, you can pass the channels array on the subscriber object with the device tokens for the push provider of your choice. Here is an example with fcm:

novu.trigger("workflow-id", {
  to: {
    subscriberId: "subscriber-id",
    channels: [
      {
        providerId: "fcm",
        credentials: {
          deviceTokens: ["token-1", "token-2"],
        },
      },
    ],
  },
  payload: {},
});

Manual

Use the Novu Set Credentials API to update subscriber profiles with device tokens. You can read more about the API in the API Reference or the FCM Example

Frequently Asked Questions

How to remove one device token from subscriber credentials?

To remove a device token from subscriber credentials, you need to get the current device tokens from subscriber credentials, remove all deviceTokens, remove the token you want to remove and then update the subscriber credentials with new device tokens.

import {
  Novu,
  PushProviderIdEnum
} from '@novu/node';

const novu = new Novu('<NOVU_SECRET_KEY>');

// fetch subscriber details
const subscriber = await novu.subscribers.get('subscriberId');

// get current device tokens from subscriber credentials for the provider
const currentDeviceTokens = subsciber.data.data.channels.find(
  // _integrationId can also be checked in place of providerId ;
  (channel) => channel.providerId === PushProviderIdEnum.FCM,
).credentials.deviceTokens;

// remove all device tokens
await this.novu.subscribers.setCredentials(
  'subscriberId',
  PushProviderIdEnum.FCM, {
    deviceTokens: []
  },
);

// remove the token you want to remove
const newDeviceTokens = currentDeviceTokens.filter(
  (token) => token !== 'token-to-be-removed',
);

// update subscriber credentials with new device tokens
await this.novu.subscribers.setCredentials(
  'subscriberId',
  PushProviderIdEnum.FCM, {
    deviceTokens: newDeviceTokens
  },
);
Are we missing a provider you'd like to use for PUSH channel? Please consider adding a new feature request on github or help us upvoting the existing ones on our public roadmap