@novu/react
package offers an interface that enables you to build a custom notifications UI using React hooks that are powered by real-time data from the Novu services.
These hooks are designed for use in both mobile and web applications, offering a flexible approach to building a custom notifications UI tailored to your application’s requirements.
Install the @novu/react package
Implement the NovuProvider
applicationIdentifier
in the Novu Dashboard under the API
keys page. The subscriberId
is the
unique identifier of the user in your application, learn more about
subscribers here.Create the custom Inbox UI
BellButton
component fetches the unread notifications count and renders the count value in the indicator.NotificationsList
component retrieves and displays the notifications list with infinite scrolling functionality.NotificationItem
component renders each notification item.When any action is performed on the notification
instance for example “read” button is clicked,
the SDK will optimistically update notification that will result in the useNotifications
hook rerender, so yo don’t need to refetch and manually update your UI.