Date Range filtering for In-App notifications
Is there is way to filter the incoming notification in the in-App setup by date range?
For example if provided with a date range, then only fetch paginated notifications for that date range.
I could not find anything in the documentation or in the code. Let me know if I need to raise this as an issue on Github!
7 Replies
Not at this time, however feel free to upvote analytics dashboard in the backlog
https://roadmap.novu.co/roadmap
There might be a workaround for the time being, I haven't tested it, but it makes sense for it to work.
You could potentially fetch all notifications and then perform client-side filtering based on the
createdAt
property of each notification.
To fetch notifications, you can use the fetchNotifications method provided by Novu's headless API. After fetching, you can implement your own logic to filter the notifications according to the desired date range by comparing the createdAt
dates of the notifications to your specified range .
Here's an example in JavaScript:
Use this as reference:
https://docs.novu.co/notification-center/client/headless/get-started@Emil I also thought the same but seems like we have a lot of data (1000+ notifications per account) and it is growing more every day. So somewhere I feel that doing either server-side or client side rendering with increasing data will increase the load gradually and is not an optimal way 😓
Yeah, I totally get it.. We will announce once this feature is available.
@Nitin Do you mind share your use case with Novu maybe?
Yes yes sure. Do I share here only or is there a separate thread / channel for it?
@Nitin You can do it here
@Nitin ping