Remove details from subscribers
I want to remove the first name, email and phone from a subscriber. How can i achieve this? I tried sending null as value for these fields in the payload but only email is getting removed. I'm using self hosted Novu and using nodejs sdk to interact with it.
13 Replies
Hi @Rahul-evolvier, 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.
-----------------------------
While I generate an answer, here are some sources that might be helpful:
* React
* NodeJS quickstart
* How to send web push notifications with FCM and Novu
* Subscribers
-----------------------------
Answer
To remove the first name, email, and phone from a subscriber using the Node.js SDK in Novu, you should consider updating the subscriber with empty strings instead of
null
. Sending null
may not always work as expected for certain fields.
Here is the code snippet to update these fields:
(1) , (2) , (3)
This should effectively remove the values for firstName
, email
, and phone
from the subscriber.Still the values for firstname and phone persists in Novu
Got it. Tagging @Support for additional help.
Hey @Rahul-evolvier 🙂 Two solutions I can think of, one is to remove the subscribe and recrate them with the minimal fields you need, the other is to use the API directly, this seems to be an issue with the nodejs sdk. I'll reach out to the team and let them know. Would you mind sharing why do you want to remove this? how are you planing on using this data?
When the user in my app logs out i want all his related information be removed from his corresponding subscriber except the app's player id for push notifications. Will i be able to unset values using the API directly?
@Rahul-evolvier would you mind sharing why do want that behavior?
@Rahul-evolvier yes, that is correct, using the API you can unset those fields (I just tested first name and last name)
The user might uninstall the app and then install at a later point of time when they install the app again then we will have two subscribers with same details except for player id.
@Rahul-evolvier I think another way to solve this is set the subscriberId to the play id, and then won't get duplication with subscriber, wdyt?
but play id will change when the user reinstalls the app.
oh got it, so not the right way to solve it
Yeah
@Rahul-evolvier, you just advanced to level 3!