c15t
/
C15T Logo
Select a framework
Frameworks
Welcome to c15t Docs
Introduction to Consent Management (c15t)
AI Tools Integrations
OSS
Contributing to c15t.com
License
Building Privacy Tools in the Open
Legal
Cookie Policy
Privacy Policy
C15T Logo
HomeFrontendIntegrationsSelf HostChangelog
xbskydiscordgithub1.4k
c15t
/
C15T Logo
Select a framework
Frameworks
Welcome to c15t Docs
Introduction to Consent Management (c15t)
AI Tools Integrations
OSS
Contributing to c15t.com
License
Building Privacy Tools in the Open
Legal
Cookie Policy
Privacy Policy
home-2Docs
chevron-rightFrameworks
chevron-rightJavascript
chevron-rightCallbacks

Callbacks

Learn how to use callbacks to respond to c15t events in your application.

Implementing Callbacks

import { configureConsentManager, type ConsentManagerOptions } from 'c15t';

export const c15tConfig: ConsentManagerOptions = {
  mode: 'c15t',
  backendURL: "https://your-instance.c15t.dev",
  callbacks: {
    onBannerFetched(response) {
      console.log('Consent banner fetched', response);
    },
    onConsentSet(response) {
      console.log('Consent has been saved', response);
    },
    onError(error) {
      console.log('Error', error);
    },
  }
};

const c15t = configureConsentManager(c15tConfig);

Available callbacks

onBannerFetched

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

onConsentSet

Called when the consent is set.

onError

Called when an error occurs.

Available in other SDKs

nextNext.jsreactReact
C15T Logo
Leverage native React components for seamless integration and high performance in a robust Consent Management solution that empowers your development team while prioritizing privacy and compliance.
Product
  • Documentation
  • Components
Company
  • GitHub
  • Contact
Legal
  • Privacy Policy
  • Cookie Policy
c15t