useNovu hook provides direct access to the Novu client instance from anywhere in your application. This hook must be used within a component that is wrapped by the NovuProvider.
Return Value
| Property | Type | Description |
|---|---|---|
novu | Novu | The Novu client instance that provides access to all Novu API methods |
Example usage
Here’s how to use theuseNovu hook to interact with the Novu client:
Managing individual notifications
The Novu client provides methods for managing individual notifications:Updating single workflow’s channel preferences
Workflow’s channel preferences can be updated usingnovu.preferences.update method.
Updating multiple workflow’s channel preferences
Usingnovu.preferences.bulkUpdate multiple workflow’s channel preferences can be updated at once.
Listening to real-time events
The Novu client allows you to listen for real-time events:The Novu client instance provides access to all the functionality available in the Headless API. For a complete list of methods and events, refer to the API documentation.