Callbacks

August 20, 2025

Implementing Callbacks

Due to the nature of Next.js App Directory, we have to define callbacks to run in a client component.

app/layout.client.tsx

Info

Ensure you import this component inside the ConsentManagerProvider component in your app/layout.tsx file.

app/layout.tsx

Available callbacks

onBannerFetched

Called when the consent banner is fetched; not invoked when the banner is in offline mode.

Loading…

onConsentSet

Called when the consent is set.

Loading…

onError

Called when an error occurs.

Loading…