1

Add a push channel provider

To send push notifications using Novu, you need to set up a provider in the integration store.

  1. Go to the Novu Dashboard and click “Integrations” on the left sidebar
  2. Locate your desired push provider and configure it with the required credentials
  3. Ensure the provider is enabled
2

Set up push channel in a workflow

Add push notifications to a new or existing workflow.

  1. Navigate to the “Workflows” section in the Novu Dashboard
  2. Click “Add a Workflow” or select an existing workflow
  3. Add a step and choose “Push” as the channel
  4. Configure the push step by adding static or dynamic content such as title, message body, and variables
3

Store device tokens in subscriber profiles

For push notifications to reach the right subscribers, store provider-specific device tokens or identifiers.

  • Follow your provider’s documentation to obtain device tokens
  • Use Novu’s subscriber management features to add these tokens to the subscriber profiles
4

Verify provider configuration

Before triggering workflows, ensure your provider configuration is complete.

  • Refer to your push provider’s documentation to confirm all required steps are correctly set up
  • Double-check any provider-specific settings in the integration store
5

Trigger and test push workflow

Test the push workflow to ensure everything is working as expected

  1. Go to the “Workflows” section in the Novu Dashboard and select your configured workflow
  2. Use the “Test Workflow” option
  3. Verify the push notification delivery in Novu Logs or the push provider’s dashboard

Supported providers

Novu supports multiple active providers for push channel.
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

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 },
);

Was this page helpful?