N
Novu5mo ago
akash

How you are consider the event count

I have a couple of questions regarding the event count functionality: Event Triggering Logic: Could you please clarify how events are counted? Are events only considered when we explicitly call the trigger event function, or are they also triggered by other API actions such as create, subscribe, etc.? Notification Handling: We're currently facing an issue where, when we send a notification from the backend, it correctly reflects on the frontend in terms of the updated count (using useCount). However, useNotification does not reflect the new notification unless we make an API call to fetch the notification details (like description and body). Could you please guide us on how to ensure that useNotification receives and displays the latest notifications without requiring an additional API call? We’d appreciate your assistance to help us streamline our current implementation. Thank you!
10 Replies
Pawan Jain
Pawan Jain5mo ago
@akash - When a workflow is triggered to one subscriber, it becomes an event. - No, using subscribers api does not counted as event. Only worklfow triggered is counted as event - You will need to use socket events checkout this documentation: https://docs.novu.co/platform/sdks/react/hooks/use-novu#listening-to-real-time-events
useNovu | Novu Documentation
Learn how to use the useNovu hook to access the Novu client instance in your React application
akash
akashOP5mo ago
Okay, Let me check. @Pawan Jain Is there are any provision to display the notification based on category,workflow or workflow tags. Example:- I have two workflow one is for vehicle notification and one is for fleet notification so in inbox i want to give categories or something like tabs from where i can able to see all, vehicles and fleets notifications.
Pawan Jain
Pawan Jain5mo ago
@akash Checkout this documentation on how to show tabs based on workflow tags https://docs.novu.co/platform/inbox/react/multiple-tabs
akash
akashOP5mo ago
Okay, Thank you for your help. Either creating tabs is that possible like i create my own custom dropdown with tags and then i pass those tags in api to filtering out notifications?
Pawan Jain
Pawan Jain5mo ago
Yes, you can create dropdown, you will have to build custom UI for this, either using hooks or @novu/js
akash
akashOP5mo ago
Okay, I'll check it. If there is an issue during the trigger event and it fails, is it still counted as a successful trigger event at your side ?
Novu_Bot
Novu_Bot5mo ago
@akash, you just advanced to level 2!
Pawan Jain
Pawan Jain5mo ago
Yes it will be triggered as event
akash
akashOP5mo ago
But if it is failed than why is counted as a success at your side?
Pawan Jain
Pawan Jain5mo ago
@akash if transactionId is returned in repsonse of events trigger api, then Novu will process the event and hence it is billed

Did you find this page helpful?