Set feed dynamically using trigger override
We are a multi tenant app where a user can be a part of many orgs using the same user id. We have all of our users added as subscribers and we have notifications flowing from our API to Novu. When we pull the notifications for a particular subscriber we’d like to separate them based on feed id. We know we can do this by assigning a feed to the In App node in the template workflow, but we don’t want to have to create a separate feed manually for each of our orgs.
It looks like we can create feeds using the API so I’m wondering if there is a way to override the feed the In App node uses in the workflow template using the trigger override so we can set it dynamically based on the users current org?
Our goal is to create a feed for each org using the org id for the feed name. When the notification is triggered we’ll look up the correct feed using the current user’s selected org and set it using the override property of the payload.
If this isn’t possible, would a PR that allows for this be considered?
3 Replies
@Engineering I know we don't have dedicated api for this.
But is there any workaround?
Probably https://docs.novu.co/api/update-notification-template/ can be used with few tweaks
Update notification template - Novu API Reference
Novu is an open-source notification infrastructure built for the engineering teams to help them build rich product notification experiences without constantly re-inventing the wheel.
Just to clarify the usecase, you want all members of the org to see the same notifications? Maybe another approach I would suggest to try is create a Topic for each organization, and subscriber all organization users to this particular topic, if your usecase is to send the same notificaiton to all org members, you can trigger your event to the particular topic and novu will send it out to all org members.
The feeds functionality was mainly created to allow individual subscriber feeds experience for example: A tab for "Social" events, "System alerts" and etc... Wouldn't reccomend to use this for multi tenancy usecases.
@dimagrossman thanks for the info. I came to realize that feeds weren't what I was looking for and in the end went with creating a subscriber per org member for each user. Will take a look at topics and see how we can utilize those in the future.