What is a Subscriber?

A subscriber is an entity to which notifications are sent. It is a Novu term similar to a user in your system. As in your system, a user is identified by a unique id, similarly in Novu, a subscriber is identified by a unique id called subscriberId. We recommend that the existing value you use in your system as a userId to be used as subscriberId in Novu. Read more about subscribers on subscribers documentation page.

Is it necessary to use subscriberId as same as userId?

No, it is not necessary to use subscriberId as same as userId. You can use any unique id as subscriberId. We recommend using userId as subscriberId to avoid any confusion. Some of our customers use a pattern like auth0|userId as a value for subscriberId.

What is the right approach to add Subscribers?

Subscribers can be added either ahead of trigger or inline of trigger. One way to add a subscriber using inline of trigger is to create a new subscriber in Novu as soon as they sign up or register in your system.

You can add your existing users as subscribers in Novu using bulk create subscriber creation method.

Can Subscriber credentials be added while creating a new Subscriber?

Subscriber credentials for Push and Chat channel providers cannot be added while creating a new subscriber. Subscriber credentials for Push and Chat channel providers can be added using the update subscriber credentials api or corresponding sdk methods.

SMS and Email channels are a bit different because all providers can work with the same value, so email and phone attributes can be added while creating a new Subscriber.

Can Subscriber preferences be updated while adding a new Subscriber?

Subscriber preference cannot be updated while adding a new subscriber. Novu sets all channels as true by default for new subscribers. You can modify preferences at any time. Read more about subscriber preferences.