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-rightReact
chevron-rightQuickstart

React Quickstart

Learn how to integrate c15t into your React application with this step-by-step guide. We'll cover installation, configuration, and basic usage.

CLI Setup (Recommended)

You can get started with the @c15t/cli which will generate the code for you!

npx @c15t/cli generate

Manual Setup

Install @c15t/react Package

npm install @c15t/react

Add to Your Application

src/App.tsx
import { 
  ConsentManagerDialog,
  ConsentManagerProvider,
  CookieBanner,
} from '@c15t/react';

function App() {
  return (
    <ConsentManagerProvider options={{  
      mode: 'c15t', 
      backendURL: "https://your-instance.c15t.dev",
      consentCategories: ['necessary', 'marketing'], // Optional: Specify which consent categories to show in the banner. 
      ignoreGeoLocation: true, // Useful for development to always view the banner.
    }}>
      <div className="App">
        {/* Your application content */}
      </div>
      <CookieBanner />
      <ConsentManagerDialog />
    </ConsentManagerProvider>
  );
}

export default App;

Storing Consent

We recommend using the hosted solution with consent.io to store your consent.

Available in other SDKs

javascriptJavaScriptnextNext.js
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