Push notifications are short, targeted messages delivered to a user’s device or browser, often through mobile apps or websites. They serve as a powerful communication tool, offering real-time updates, reminders, and personalized content. Push notifications can range from news alerts and social media updates to promotional offers and important app notifications.

These messages are designed to engage users and keep them informed about relevant events or activities, even when they are not actively using an app or browsing a website. They play a crucial role in user engagement and retention for businesses and organizations, as they can re-engage users and prompt them to take specific actions.

Novu can be used to deliver push notifications to your customers devices using a unified delivery API. Both Mobile and Web push notifications are supported.

Using push channel with Novu

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.

Are we missing a provider you'd like to use for this channel? Please consider adding a new feature request on github or help us upvoting the existing ones on our public roadmap.

Frequently Asked Questions

1. 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.

  • Node.js

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

const novu = new Novu('<NOVU_API_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 },
);