Create subscriber - novu.subscribers.identify() #3784
-
When using https://docs.novu.co/overview/quickstart/get-started-with-nextjs#subscribers If this is called for the first time with email: await novu.subscribers.identify('123', {
email: null,
}); What if I call it again for in-app notification just using it without the data object? Will this still identify the same subscriber based solely on await novu.subscribers.identify('123'); |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
I think it performs upserts, so yes it should update the subscriber.
I think it always looks for subscriber id. You should be able to safely update email and other fields and expect it will always look for the same user. |
Beta Was this translation helpful? Give feedback.
-
@jinsley8 I just checked source code to be 100% sure. It always get subscriber ONLY by id and current environment (environment is assigned to the api key), so you can change email and other fields. if subscriber doesnt exist - then it creates new one |
Beta Was this translation helpful? Give feedback.
@jinsley8 I just checked source code to be 100% sure.
It always get subscriber ONLY by id and current environment (environment is assigned to the api key), so you can change email and other fields.
if subscriber doesnt exist - then it creates new one
if subscriber exists - performs update