#Unable to set integration id when setting subscriber credentials

1 messages · Page 1 of 1 (latest)

bleak pollenBOT
#

Hi @viral berry, I'm an AI assistant for Novu. While a team member reviews this question, I'll see if I can find relevant sources for your question.

#

Answer

It sounds like you are encountering an issue with setting the integrationIdentifier when updating subscriber credentials for OneSignal in Novu. As of now, the Novu API supports specifying an integrationIdentifier to select a specific integration, but it appears that you are experiencing difficulties.

Here's how you can set the integrationIdentifier when using the setCredentials method:

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

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

await novu.subscribers.setCredentials('subscriberId', PushProviderIdEnum.OneSignal, {
  deviceTokens: ['ad0452ca-3ca7-43b5-bf9b-fa93fd322035'], // Your user's unique 'player_id' from OneSignal
  integrationIdentifier: 'one-signal-MnGLxp8uy' // The specific OneSignal provider integration ID
});

If you're encountering an error, double-check that:

  1. The integrationIdentifier provided matches the correct ID of the OneSignal provider you want to use.
  2. The providerId is correctly set to one-signal.

For reference, see the official documentation on updating subscriber credentials here (1) .

If the issue persists, you might want to ensure you're using the latest version of the Novu SDK, as there was a recent update to include the integrationIdentifier field in the Node.js SDK (2) .