Use Inbox with workflows from the current Dashboard or @novu/framework.
- React: @novu/react
- Angular, Vue, Vanilla JS, and headless clients: @novu/js
Why you should upgrade
- Appearance and layout options that replace the legacy
stylesAPI - A notification object that includes archive, snooze, severity, and action methods
- A smaller client surface:
@novu/reactfor React,@novu/jsfor every other host - Compatibility with current Dashboard workflows and
@novu/framework
Breaking Changes
These changes apply to every host. React uses component props. Angular, Vue, and Vanilla JS pass the same fields toNovuUI options and mountComponent props.
Components
- The
PopoverNotificationCentercomponent has been replaced with theInboxcomponent. - The
NotificationCentercomponent has been replaced with theNotificationscomponent. - The
NotificationBellcomponent has been replaced with theBellcomponent.
Styling
- The
stylesprop is replaced by an enhanced, easy to useappearanceprop to customize the notification components. For more information onappearancecustomization, visit here.
Notification
- Removal of
seen,lastSeenDate,content,templateIdentifier,payload,ctaproperties from the Notification object. - Archive, snooze, and severity support were added to the Notification object.
Notification object
Types
The legacy
_id is the notification identifier and is not the same value as transactionId, which identifies the workflow trigger.Subscriber prop
ThesubscriberId prop is deprecated. Pass subscriber with either a subscriber ID string or a subscriber object.
Choose the Inbox package
There is no native Angular or Vue Inbox package. Those applications mount the same UI through
@novu/js. React Native uses @novu/react-native.
The breaking changes, tabs, appearance, actions, and notification methods on this page apply to every host. React uses component props. Angular, Vue, and Vanilla JS pass the same fields to NovuUI options and mountComponent props.
React
Uninstall@novu/notification-center and install @novu/react. Replace NovuProvider, PopoverNotificationCenter, and NotificationBell with <Inbox />.
Use subscriber, not the deprecated subscriberId prop. The React examples below map the remaining components, fields, and handlers. For HMAC, localization, and layout, follow the React Inbox quickstart.
Angular
Uninstall the Angular Notification Center wrapper and install@novu/js. There is no native Angular Inbox package.
Mount Inbox with NovuUI from @novu/js/ui on an existing header, navbar, or sidebar element. Use a template reference such as #novuInbox, mount in ngAfterViewInit, and unmount in ngOnDestroy. Pass appearance, tabs, localization, and click handlers in the constructor options or in mountComponent props.
Follow the Angular Inbox quickstart for the install.
Vue
Uninstall the Vue Notification Center wrapper and install@novu/js. There is no native Vue Inbox package.
Mount Inbox with NovuUI from @novu/js/ui from onMounted against a template ref, and unmount in onUnmounted. Inbox does not support server-side rendering. For Nuxt, wrap the component in <ClientOnly> and follow the Nuxt Inbox quickstart.
Follow the Vue Inbox quickstart for the install.
Vanilla JS
Uninstall the web component, iframe embed, or@novu/headless client and install @novu/js.
Mount Inbox with NovuUI from @novu/js/ui after DOMContentLoaded on an existing element. A bundler is required for the @novu/js/ui import. For a plain HTML page, follow the Vanilla JS Inbox quickstart, which loads the UI bundle and stylesheet.
For a custom feed without the prebuilt UI, replace @novu/headless with @novu/js and rebuild queries, counts, and mutation methods against the current notification object. See the JavaScript SDK.
Basic usage
The examples below use@novu/react. For Angular, Vue, and Vanilla JS, pass the same options to NovuUI and the same handlers in mountComponent props.
Legacy implementation with @novu/notification-center
Current implementation with @novu/react
Notification center without bell icon
The @novu/react package introduces a flexible way to display notifications as a list without the default bell icon. Use theInbox and Notifications components to achieve this functionality.
Legacy implementation with @novu/notification-center
Current implementation with @novu/react
Custom bell icon
Customize the bell icon that triggers the notifications popover using therenderBell prop.
Legacy implementation with @novu/notification-center
Current implementation with @novu/react
Notification actions
Handle user interactions with notifications effectively using the action handlers provided by@novu/react.
onNotificationClick
Trigger a callback function when a user clicks on a notification item.Legacy implementation with @novu/notification-center
Current implementation with @novu/react
onPrimaryActionClick and onSecondaryActionClick
Handle primary and secondary actions within a notification explicitly.Legacy implementation with @novu/notification-center
Current implementation with @novu/react
Avatar icons
In the legacy implementation, you could set a notification’s avatar icon by enabling the Add an avatar option in the workflow UI. Novu would then use the avatar field of the actor subscriber as the icon. In the new implementation, you can set the avatar icon for a notification by adding the avatar icon in the workflow UI. There are three options to choose from:- Use a default avatar icon.
- Use a hard-coded avatar icon URL.
- Use a payload variable to dynamically set the avatar icon.
Popover positioning
For advanced positioning and styling of the notifications popover, integrate third-party popover libraries such as Radix UI.Legacy implementation with @novu/notification-center
Current implementation with @novu/react and Radix UI as an example
Custom notification item
Customize the appearance and structure of individual notification items using therenderNotification prop.
Legacy implementation with @novu/notification-center
Current implementation with @novu/react
Styling with appearance prop
Customize the overall look and feel of the notification components using the appearance prop, which supports both CSS objects and class names (including Tailwind CSS classes).Legacy implementation with @novu/notification-center
Current implementation with @novu/react
appearance customization visit here.
Multiple tabs support
Organize notifications into different categories using tabs by leveraging the tags property in workflow definitions and the tabs prop in the Inbox component.Create multiple tabs
Legacy implementation with @novu/notification-center
After defining the feeds on the workflow UI, you were able to filter notifications based on the feedIdentifier.
Current implementation with @novu/react
- Define multiple workflows with relevant tags.
- Use those tags in the
tabsprop of theInboxcomponent.
filter object that supports tags, data, and severity. The older value array is deprecated, so replace value: ['security'] with filter: { tags: ['security'] }.
Localization
Customize the language and text content of the notification components using the localization prop. Refer to the localization documentation.HMAC encryption
The process remains the same as before. For more information, refer to Secure your inbox with HMAC encryption.Handling notifications
Legacy mutation hooks such asuseUpdateAction are replaced by methods on the notification object.
Each method returns a promise, so handle failures rather than assuming the change succeeded.