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-rightStoring-consent
chevron-rightOffline

Offline

Store consent decisions in the browser with offline mode, perfect for sites without backend requirements

The offline mode provides a simple, browser-based approach to storing user consent decisions without requiring a backend server.

Key Characteristics

  • No backend required - Everything is stored locally in the browser
  • Simplified setup - Get started quickly with minimal configuration
  • Independence - Works without external services or APIs
  • Fast implementation - Ideal for prototyping and simpler sites

Implementation

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

function App() {
  return (
    <ConsentManagerProvider options={{  
      mode: 'offline', 
      consentCategories: ['necessary', 'marketing'], // Optional: Specify which consent categories to show in the banner. 
    }}>
      <div className="App">
        {/* Your application content */}
      </div>
      <CookieBanner />
      <ConsentManagerDialog />
    </ConsentManagerProvider>
  );
}

export default App;

How It Works

Info

Offline mode provides the same API interface as the standard client but operates completely client-side.

The offline mode implements the same interface as the standard client, but with the following differences:

  1. Storage: All consent preferences are stored in the browser's localStorage using the configured key
  2. Network: No network requests are made, all operations happen locally
  3. Consent Banner: The banner visibility is determined by checking if a value exists in localStorage
  4. Consent Verification: Always returns a successful response

Available in other SDKs

nextNext.jsjavascriptJavaScript
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