Learn how to use the Expo push provider to send push notifications using Novu
Expo Push is a notification delivery service provided by Expo.To enable Expo Push integration, you need to create an Expo Application Services (EAS)account and generate an access token in the EAS dashboard.The overrides field supports all Message Request values. An example of the same follows:
Copy
Ask AI
import { Novu } from "@novu/node";const novu = new Novu("<NOVU_SECRET_KEY>");novu.trigger("<WORKFLOW_TRIGGER_IDENTIFIER>", { to: { subscriberId: "<SUBSCRIBER_ID>", }, payload: { abc: "def", },});
Before triggering the notification to a subscriber(user) with push as a step in the workflow, make sure you have added the subscriber’s device token as follows:
Copy
Ask AI
import { Novu,PushProviderIdEnum} from '@novu/node';const novu = new Novu("<NOVU_SECRET_KEY>");await novu.subscribers.setCredentials('subscriberId', PushProviderIdEnum.EXPO, {deviceTokens: ['token1', 'token2'],});