Skip to main content

The useCounts hook provides a way to fetch various notification counts, including unread, unseen, and total counts. This hook is useful for displaying notification badges and indicators in your application.

Hook Parameters#

ParameterTypeRequiredDescription
storeIdstringNoFilter counts by a specific store ID
queryobjectNoAdditional query parameters for filtering

Return Value#

Example Usage#

Here’s how to use the useCounts hook to fetch and display notification counts:

With Store ID#

You can filter counts for a specific store:

With Query Filters#

You can also apply additional filters using the query parameter:

Note

refetch function can be used to refetch updated counts after notifications are marked as read/unread/archived etc.