Headless notification Inbox for JavaScript applications
Learn how to use the Novu Inbox API to build your own custom inbox UI.
Build a fully custom notification inbox with the headless version of Novu's inbox notification package without being constrained by the default Inbox UI or dependencies.
This lightweight solution gives you full control over the UI and provides all the necessary API methods for fetching, managing, and receiving real-time notifications in your application.
Getting started
Follow these steps to initialize the SDK and fetch notifications:
Initialize the SDK
Initialize the Novu client with your application identifier and the current user's subscriber ID.
Fetch notifications
Use the novu.notifications.list()
method to retrieve a paginated list of notifications for the subscriber.
Display notifications
Use your preferred framework or templating logic to render the notifications. For example, you can loop through the notifications
array and display relevant fields:
Real-time notifications
Events are emitted when notifications are received, and when the unread notificatons count changes. novu.on()
is used to listen to these events.
For the full list of methods available, see the API Reference.
Available methods
Here are a few commonly used notification, preferences and events methods you’ll likely need when working headlessly:
Action | Method Example |
---|---|
Fetch notifications | novu.notifications.list() |
Count notifications | novu.notifications.count() |
Mark as read | notification.read() or novu.notifications.read({ notificationId }) |
Mark all as seen | novu.notifications.seenAll() |
Archive notification | notification.archive() |
Fetch subscriber's preferences | novu.preferences.list(); |
Real-time events | novu.on('notifications.notification_received', handler) |
You can interact with individual notification instances or perform bulk actions through the notifications
namespace.