NovuProvider

Learn how to use the NovuProvider component to set up the Novu context in your React application

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

PropTypeDefault
subscriberId?
string
-
applicationIdentifier?
string
-
subscriberHash?
string
-
backendUrl?
string
-
socketUrl?
string
-
children?
ReactNode
-

Example Usage

import { NovuProvider } from '@novu/react';
 
function App() {
  return (
    <NovuProvider
      subscriberId="SUBSCRIBER_ID"
      applicationIdentifier="APPLICATION_IDENTIFIER"
    >
      {/* Your app components */}
    </NovuProvider>
  );
}

On this page