Skip to main content
The NovuProvider is the top-level component that provides the Novu instance to the rest of the hooks through the context. Usually, it’s placed somewhere in the root of your application, which makes the hooks accessible throughout the application.

Props

PropertyTypeDescription
subscriberIdstringThe unique identifier of the subscriber
applicationIdentifierstringYour application identifier from Novu
subscriberHashstringHMAC encryption hash for the subscriber
contextobjectDefines contextual attributes (for example, tenant, app, team) for filtering and personalizing notifications.
contextHashstringThe HMAC-SHA256 hash of the context object. Required if context is provided and HMAC is enabled.
apiUrlstringCustom backend URL for self-hosted instances
socketUrlstringCustom socket URL for self-hosted instances
childrenReactNodeThe child components that will have access to the Novu context

Example Usage


function App() {
  return (
    <NovuProvider
      subscriber="SUBSCRIBER_ID"
      applicationIdentifier="APPLICATION_IDENTIFIER"
    >
      {/* Your app components */}
    </NovuProvider>
  );
}