N
Novuβ€’3mo ago
KG

Tenant wise in-app notification

in our use case, users can be part of multiple workspaces (tenants). Each tenant can have different set of notifications for its users and we want to show these differing notifications in the in-app inbox when the user switches between workspaces. From this documentation (https://docs.novu.co/concepts/tenants), it is not clear to me whether the Inbox component can filter tenant wise notifications for the user. Its not clear from the APIs as well.
8 Replies
Tomer Barnea
Tomer Barneaβ€’3mo ago
Hey KG, a question: is it your expectation that the user will see all notifications across all workspaces in their Inbox? Or is it your expectation that the user will see only notifications for the workspace that is active?
KG
KGOPβ€’3mo ago
user will see only the notifications only for the current (active) workspace also, I wanted to understand if there is a way to filter the in-app notifications based on filters other than the workflow tags? I am referring to this page from the docs: https://docs.novu.co/inbox/react/hooks/use-notifications#usenotifications-props
Tomer Barnea
Tomer Barneaβ€’3mo ago
Hey @KG thanks for that information. Let's start with tenants, you are correct, there is no auto filtering per tenant on the Inbox, so you can duplicate subscribers based on their workspaces, and use a simple naming convetion for their subscribers Id's like so: {subscriberId: "${internal_user_id}-${internal_workspace_id}"} that way you can easily switch them, and trigger them without any more work. Combining that with topics (https://docs.novu.co/concepts/topics#topics) per tenant you can group them easily and trigger all tenant based subscribers at the same time.
Tomer Barnea
Tomer Barneaβ€’3mo ago
We are looking right now to overall Novu's tenants capabilities, see on the roadmap (https://roadmap.novu.co/roadmap), I'd love if you can add your use cases and thoughts about how you would use this πŸ˜„ Now, as for filtering, are you looking to filter the notification feed using dynamic hooks? text-based search functionality? How would the subscribers benefit from that filtering?
KG
KGOPβ€’3mo ago
Thanks for sharing the roadmap. I will add my use case in it. My use for filters is that every workspace user will get updates regarding the worskpace notifications but sometimes, I need to hide certain notifications from users based on their workspace role. E.g. guest user does not need to see plan expiry, plan upgrade, discounts related messages. One simple way is to hardcode this logic in the novu workflow but we wanted to keep it slightly flexible by pushing all workspace messages to all workspace users and then add the Authorization layer on top of novu APIs to filter out the messages which we need to hide based on user and message attributes. This will allow us to centrally manage all auth logic instead of replicating it at multiple places (novu workflows in this case). Furthermore, this kind of implementation also allows us to dynamically change the feed of the workspace user in case his role has changed. E.g. user role changed from the guest to admin will allow the user to see any historical messages related to upgrades, discounts, etc. Without native novu filters, the implementation is not very clean. We can push all messages to all workspace users and they dynamically keep calling novu api and filtering messages till the time we reach the desired number of messages requested by the user.
Tomer Barnea
Tomer Barneaβ€’3mo ago
Got it thanks for the update. So as you said, this is not the way Novu is designed, right now the assupmtion is if a subscriber (user) is target the notification should show for them, I assume you plan to use topic for the grouping funcationally, so one solution would be to create sub groups based on their role and target multiple topics. As you do that I would recommend you take a look at the ability to filter the preferences the subscriber can see based on tags (https://docs.novu.co/inbox/react/components/inbox#filter-visible-preferences) With that being said, and with the fear of sounding repetitive πŸ˜„ If you take a look at the roadmap, there is an item there called subscriptions; this will allow you to "broadcast" a message to a topic and let subscribers (users) register to create a subscription. Once they have a subscription, they will receive the notification for the ultimate personalization. If you can also add your use case there that would be great, and allow us to take that into account as we build this new capability. With this, you can manage your auth layer in your app and decide who can create a subscription to what.
Novu
- Novu
KG
KGOPβ€’3mo ago
sure, usage of topics and subscriptions is noted. very much similar to how kafka topics are. topics are a good way to push workspace notifications to all workspace users in one-go. sorry one small follow-up question. in the example given on the page shared by you, the preference filters are in AND or OR condition?
Tomer Barnea
Tomer Barneaβ€’3mo ago
The filters are using OR conditions between them. Quoting "The filtering works by matching the workflow tags field with the specified filter tags value, showing workflows that contain at least one associated tag."
Want results from more Discord servers?
Add your server