Callbacks
Learn how to use callbacks to respond to consent management events in both JavaScript and React applications.
Available callbacks
onBannerFetched
This callback is called when the consent banner is fetched, it is not called when the banner is set to offline
mode.
Property
Types
onConsentSet
This callback is called when the consent is set.
Property
Types
onError
This callback is called when an error occurs.
Property
Types
Implementing Callbacks
Due to the nature of Next.js App Directory, we have to define callbacks to run in a client component.
Info
Ensure you import this component inside the ConsentManagerProvider component in your app/layout.tsx
file.
Edit on GitHub
Last updated: May 12, 2025