The headless version of Novu’s notification library package provides users with a lightweight solution for integrating notification functionality into their web applications. With just the essential API methods, users can easily incorporate our notification system into any framework or vanilla JavaScript project, without being constrained by our default UI or dependencies.
Novu headless library provides listenUnseenCountChange API to listen to real-time socket changes and get updates about new notifications added to the user’s feed.
headlessService.listenUnseenCountChange({ // this will run every time there's a change in the `unseen_count` in real-time listener: (unseenCount: number) => { console.log(unseenCount); },});
headlessService.listenUnreadCountChange({ // this will run every time there's a change in the `unread_count` in real-time listener: (unreadCount: number) => { console.log(unreadCount); },});
If you’re ready to start using the Headless Notification Center, check out our guide!
We have headless.initializeSession method to generate token and initialize the session. If user log out and new user login, then calling again this method with second user subscriberId will generate new token and new session.
Can headless be used with mobile based platforms like flutter and react native?
Currently, headless can not be used with react native and flutter. Checkout the progress on mobile platform support on github issue #4499.