# c15t Full Context > All generated markdown documentation pages flattened into one file. ## Included Pages - [Frameworks](https://c15t.com/docs/frameworks): Reference page for frameworks. - [Quickstart](https://c15t.com/docs/frameworks/react/quickstart): Add consent management to your React app in under 5 minutes. - [Optimization](https://c15t.com/docs/frameworks/react/optimization): Improve c15t startup performance in React with prefetching, proxy rewrites, and rendering tradeoffs. - [AI Agents](https://c15t.com/docs/ai-agents): Integrate c15t with AI coding assistants using the docs bundled in each package and c15t agent skills. Give agents version-matched local docs for consent management, banners, script loading, callbacks, and integrations. - [Initialization Flow](https://c15t.com/docs/frameworks/react/concepts/initialization-flow): What happens from provider mount to first render — the full consent lifecycle. - [Client Modes](https://c15t.com/docs/frameworks/react/concepts/client-modes): Choose how c15t connects to its backend - full hosted integration, offline-only, or bring your own backend. - [Consent Models](https://c15t.com/docs/frameworks/react/concepts/consent-models): How c15t determines consent behavior based on legal jurisdiction. - [Policy Packs](https://c15t.com/docs/frameworks/react/concepts/policy-packs): How c15t resolves regional consent policies and what a policy pack controls. - [Consent Categories](https://c15t.com/docs/frameworks/react/concepts/consent-categories): How c15t organizes tracking technologies into five consent categories. - [Cookie Management](https://c15t.com/docs/frameworks/react/concepts/cookie-management): How c15t manages cookies through script, iframe, and network gating - [Glossary](https://c15t.com/docs/frameworks/react/concepts/glossary): Key terms used throughout the c15t documentation. - [Script Loader](https://c15t.com/docs/frameworks/react/script-loader): Gate third-party scripts behind consent in React — load Google Analytics, Meta Pixel, and other tracking scripts only when users grant permission. - [Iframe Blocking](https://c15t.com/docs/frameworks/react/iframe-blocking): Block embedded content (YouTube, social widgets, maps) until users grant consent for the appropriate category. - [Network Blocker](https://c15t.com/docs/frameworks/react/network-blocker): Block outgoing network requests to third-party domains until the user grants consent for the appropriate category. - [Callbacks](https://c15t.com/docs/frameworks/react/callbacks): React to consent lifecycle events - initialization, consent changes, errors, and revocation reloads. - [Internationalization](https://c15t.com/docs/frameworks/react/internationalization): Translate consent UI into 30+ languages with built-in translations, custom overrides, and automatic browser language detection. - [Policy Packs](https://c15t.com/docs/frameworks/react/policy-packs): Configure regional consent policies in React — hosted mode, presets, and offline fallback. - [Server-Side Utilities](https://c15t.com/docs/frameworks/react/server-side): Fetch consent data on the server for SSR hydration — eliminate the loading flash and improve performance. - [ConsentManagerProvider](https://c15t.com/docs/frameworks/react/components/consent-manager-provider): The root provider component that initializes the consent system and makes consent state available to all child components. - [ConsentBanner](https://c15t.com/docs/frameworks/react/components/consent-banner): A pre-built consent banner that appears when user consent is needed. Supports policy-aware layout, theming, and advanced composition when markup must change. - [ConsentDialog](https://c15t.com/docs/frameworks/react/components/consent-dialog): A modal dialog where users can toggle individual consent categories. - [ConsentWidget](https://c15t.com/docs/frameworks/react/components/consent-widget): An inline consent management widget for embedding in settings or privacy pages. Shows category toggles with accordion layout. - [ConsentDialogTrigger](https://c15t.com/docs/frameworks/react/components/consent-dialog-trigger): A floating, draggable button that lets users re-open the consent dialog at any time. - [ConsentDialogLink](https://c15t.com/docs/frameworks/react/components/consent-dialog-link): An inline trigger for opening the consent dialog from footers, legal pages, and account settings. - [Frame](https://c15t.com/docs/frameworks/react/components/frame): A consent-gated content wrapper - children only mount when the required consent category is granted. - [DevTools](https://c15t.com/docs/frameworks/react/components/dev-tools): A development tool for inspecting consent state, geolocation, loaded scripts, and consent events in real time. - [Styling Overview](https://c15t.com/docs/frameworks/react/styling/overview): Customize every aspect of c15t's consent components using design tokens, component slots, and CSS variables. - [Design Tokens](https://c15t.com/docs/frameworks/react/styling/tokens): The six base token categories that control colors, typography, spacing, radius, shadows, and motion, plus optional dark-mode overrides. - [Component Slots](https://c15t.com/docs/frameworks/react/styling/slots): Target individual component parts with styles using the slot system - className strings or inline style objects. - [Class Names](https://c15t.com/docs/frameworks/react/styling/classnames): Style consent components using className props and per-slot className targeting via the theme. - [Tailwind CSS](https://c15t.com/docs/frameworks/react/styling/tailwind): Use Tailwind CSS utility classes to style consent components via the slot system. - [Color Scheme](https://c15t.com/docs/frameworks/react/styling/color-scheme): Support light mode, dark mode, and system preference detection in consent components. - [CSS Variables](https://c15t.com/docs/frameworks/react/styling/css-variables): Reference for all --c15t-* CSS custom properties generated by the theme system. - [useConsentManager](https://c15t.com/docs/frameworks/react/hooks/use-consent-manager/overview): The primary hook for accessing consent state and actions. Returns the full consent store including all state properties and action methods. - [Checking Consent](https://c15t.com/docs/frameworks/react/hooks/use-consent-manager/checking-consent): Use has() for flexible consent checks with AND, OR, and NOT logic. Check if any consent exists with hasConsented(). - [Setting Consent](https://c15t.com/docs/frameworks/react/hooks/use-consent-manager/setting-consent): Save, update, and reset consent preferences with setConsent(), setSelectedConsent(), and saveConsents(). - [Location Info](https://c15t.com/docs/frameworks/react/hooks/use-consent-manager/location-info): Access detected jurisdiction, country, and region. Override geolocation for testing. - [useTranslations](https://c15t.com/docs/frameworks/react/hooks/use-translations): Access the current language's translations for building custom consent UI. - [useFocusTrap](https://c15t.com/docs/frameworks/react/hooks/use-focus-trap): Trap keyboard focus within a container for accessible modal dialogs. - [useColorScheme](https://c15t.com/docs/frameworks/react/hooks/use-color-scheme): Manage light/dark mode preferences for consent components. - [useReducedMotion](https://c15t.com/docs/frameworks/react/hooks/use-reduced-motion): Detect the user's prefers-reduced-motion OS setting and reactively disable animations. - [useTextDirection](https://c15t.com/docs/frameworks/react/hooks/use-text-direction): Manage RTL/LTR text direction based on the active language for consent UI. - [useSSRStatus](https://c15t.com/docs/frameworks/react/hooks/use-ssr-status): Check whether server-side rendered consent data was used during initialization. - [useDraggable](https://c15t.com/docs/frameworks/react/hooks/use-draggable): Make an element draggable between viewport corners with snapping, persistence, and animation support. - [Troubleshooting](https://c15t.com/docs/frameworks/react/troubleshooting): Solutions for common issues with @c15t/react — provider errors, missing banners, consent persistence, and more. - [Building Headless Components](https://c15t.com/docs/frameworks/react/building-headless-components): Build policy-aware custom consent components in React using the headless hooks and policy-pack tooling. - [Headless Mode](https://c15t.com/docs/frameworks/react/headless): Build fully custom consent UI using only hooks - no pre-built components required. - [IAB TCF 2.3](https://c15t.com/docs/frameworks/react/iab/overview): Implement IAB Transparency & Consent Framework 2.3 compliance for programmatic advertising in EU/EEA jurisdictions. - [IABConsentBanner](https://c15t.com/docs/frameworks/react/iab/consent-banner): An IAB TCF 2.3 compliant consent banner that displays partner count, purpose summaries, and legitimate interest notices. - [IABConsentDialog](https://c15t.com/docs/frameworks/react/iab/consent-dialog): An IAB TCF 2.3 compliant preference center with tabbed purpose and vendor management. - [useGVLData (Internal)](https://c15t.com/docs/frameworks/react/iab/use-gvl-data): Status note for the internal GVL hook used by the built-in IAB dialog. - [Quickstart](https://c15t.com/docs/frameworks/javascript/quickstart): Get started with c15t in vanilla JavaScript — framework-agnostic consent management with no UI dependencies. - [Optimization](https://c15t.com/docs/frameworks/javascript/optimization): Improve c15t startup performance with prefetching and network tuning. - [Initialization Flow](https://c15t.com/docs/frameworks/javascript/concepts/initialization-flow): What happens from runtime creation to first state update — the full consent lifecycle. - [Client Modes](https://c15t.com/docs/frameworks/javascript/concepts/client-modes): Choose how c15t connects to its backend — full hosted integration, offline-only, or bring your own backend. - [Consent Models](https://c15t.com/docs/frameworks/javascript/concepts/consent-models): How c15t determines consent behavior based on legal jurisdiction. - [Policy Packs](https://c15t.com/docs/frameworks/javascript/concepts/policy-packs): How c15t resolves regional consent policies and what a policy pack controls. - [Consent Categories](https://c15t.com/docs/frameworks/javascript/concepts/consent-categories): How c15t organizes tracking technologies into five consent categories. - [Cookie Management](https://c15t.com/docs/frameworks/javascript/concepts/cookie-management): How c15t manages cookies through script, iframe, and network gating. - [Glossary](https://c15t.com/docs/frameworks/javascript/concepts/glossary): Key terms used throughout the c15t documentation. - [Script Loader](https://c15t.com/docs/frameworks/javascript/script-loader): Gate third-party scripts behind consent — load Google Analytics, Meta Pixel, and other tracking scripts only when users grant permission. - [Iframe Blocking](https://c15t.com/docs/frameworks/javascript/iframe-blocking): Block embedded content (YouTube, social widgets, maps) until users grant consent for the appropriate category. - [Network Blocker](https://c15t.com/docs/frameworks/javascript/network-blocker): Block outgoing network requests to third-party domains until the user grants consent for the appropriate category. - [Callbacks](https://c15t.com/docs/frameworks/javascript/callbacks): React to consent lifecycle events — initialization, consent changes, errors, and revocation reloads. - [Internationalization](https://c15t.com/docs/frameworks/javascript/internationalization): Translate consent UI into 30+ languages with built-in translations, custom overrides, and automatic browser language detection. - [Policy Packs](https://c15t.com/docs/frameworks/javascript/policy-packs): Configure regional consent policies in the headless JavaScript runtime — hosted mode, presets, and offline fallback. - [Store API Overview](https://c15t.com/docs/frameworks/javascript/api/overview): Core API entry points for JavaScript consent management — runtime creation, store access, and subscription patterns. - [Checking Consent](https://c15t.com/docs/frameworks/javascript/api/checking-consent): Read consent state from the store — check individual categories, logical conditions, and the full consent object. - [Setting Consent](https://c15t.com/docs/frameworks/javascript/api/setting-consent): Save, stage, and reset consent preferences using the store API. - [Location & Identity](https://c15t.com/docs/frameworks/javascript/api/location-info): Access detected location, override geolocation, change language, and link user identity. - [Building UI](https://c15t.com/docs/frameworks/javascript/building-ui): Build your own consent UI on top of the headless c15t store — with vanilla DOM, any framework, or the @c15t/ui theme system. - [Troubleshooting](https://c15t.com/docs/frameworks/javascript/troubleshooting): Solutions for common issues with c15t in JavaScript — store access, missing banners, consent persistence, and more. - [IAB TCF 2.3](https://c15t.com/docs/frameworks/javascript/iab/overview): Implement IAB Transparency & Consent Framework 2.3 compliance for programmatic advertising in EU/EEA jurisdictions. - [Quickstart](https://c15t.com/docs/frameworks/next/quickstart): Add consent management to your Next.js app in under 5 minutes. - [Optimization](https://c15t.com/docs/frameworks/next/optimization): Improve c15t startup performance in Next.js with same-origin rewrites, static prefetching, and dynamic-route SSR. - [Initialization Flow](https://c15t.com/docs/frameworks/next/concepts/initialization-flow): What happens from provider mount to first render — the full consent lifecycle. - [Client Modes](https://c15t.com/docs/frameworks/next/concepts/client-modes): Choose how c15t connects to its backend - full hosted integration, offline-only, or bring your own backend. - [Consent Models](https://c15t.com/docs/frameworks/next/concepts/consent-models): How c15t determines consent behavior based on legal jurisdiction. - [Policy Packs](https://c15t.com/docs/frameworks/next/concepts/policy-packs): How c15t resolves regional consent policies and what a policy pack controls. - [Consent Categories](https://c15t.com/docs/frameworks/next/concepts/consent-categories): How c15t organizes tracking technologies into five consent categories. - [Cookie Management](https://c15t.com/docs/frameworks/next/concepts/cookie-management): How c15t manages cookies through script, iframe, and network gating - [Glossary](https://c15t.com/docs/frameworks/next/concepts/glossary): Key terms used throughout the c15t documentation. - [Script Loader](https://c15t.com/docs/frameworks/next/script-loader): Gate third-party scripts behind consent in Next.js — load Google Analytics, Meta Pixel, and other tracking scripts only when users grant permission. - [Iframe Blocking](https://c15t.com/docs/frameworks/next/iframe-blocking): Block embedded content (YouTube, social widgets, maps) until users grant consent for the appropriate category. - [Network Blocker](https://c15t.com/docs/frameworks/next/network-blocker): Block outgoing network requests to third-party domains until the user grants consent for the appropriate category. - [Callbacks](https://c15t.com/docs/frameworks/next/callbacks): React to consent lifecycle events - initialization, consent changes, errors, and revocation reloads. - [Internationalization](https://c15t.com/docs/frameworks/next/internationalization): Translate consent UI into 30+ languages with built-in translations, custom overrides, and automatic browser language detection. - [Policy Packs](https://c15t.com/docs/frameworks/next/policy-packs): Configure regional consent policies in Next.js — hosted mode, presets, and offline fallback. - [Server-Side Data Fetching](https://c15t.com/docs/frameworks/next/server-side): Pre-fetch consent data in Server Components with fetchInitialData for dynamic Next.js routes. - [ConsentManagerProvider](https://c15t.com/docs/frameworks/next/components/consent-manager-provider): The root provider component that initializes the consent system and makes consent state available to all child components. - [ConsentBanner](https://c15t.com/docs/frameworks/next/components/consent-banner): A pre-built consent banner that appears when user consent is needed. Supports policy-aware layout, theming, and advanced composition when markup must change. - [ConsentDialog](https://c15t.com/docs/frameworks/next/components/consent-dialog): A modal dialog where users can toggle individual consent categories. - [ConsentWidget](https://c15t.com/docs/frameworks/next/components/consent-widget): An inline consent management widget for embedding in settings or privacy pages. Shows category toggles with accordion layout. - [ConsentDialogTrigger](https://c15t.com/docs/frameworks/next/components/consent-dialog-trigger): A floating, draggable button that lets users re-open the consent dialog at any time. - [ConsentDialogLink](https://c15t.com/docs/frameworks/next/components/consent-dialog-link): An inline trigger for opening the consent dialog from footers, legal pages, and account settings. - [Frame](https://c15t.com/docs/frameworks/next/components/frame): A consent-gated content wrapper - children only mount when the required consent category is granted. - [DevTools](https://c15t.com/docs/frameworks/next/components/dev-tools): A development tool for inspecting consent state, geolocation, loaded scripts, and consent events in real time. - [Styling Overview](https://c15t.com/docs/frameworks/next/styling/overview): Five approaches for theming consent components — design tokens, component slots, CSS variables, className, and noStyle mode. - [Design Tokens](https://c15t.com/docs/frameworks/next/styling/tokens): The six base token categories that control colors, typography, spacing, radius, shadows, and motion, plus optional dark-mode overrides. - [Component Slots](https://c15t.com/docs/frameworks/next/styling/slots): Target individual component parts with styles using the slot system - className strings or inline style objects. - [Class Names](https://c15t.com/docs/frameworks/next/styling/classnames): Style consent components using className props and per-slot className targeting via the theme. - [Tailwind CSS](https://c15t.com/docs/frameworks/next/styling/tailwind): Use Tailwind CSS utility classes to style consent components via the slot system. - [Color Scheme](https://c15t.com/docs/frameworks/next/styling/color-scheme): Support light mode, dark mode, and system preference detection in consent components. - [CSS Variables](https://c15t.com/docs/frameworks/next/styling/css-variables): Reference for all --c15t-* CSS custom properties generated by the theme system. - [useConsentManager](https://c15t.com/docs/frameworks/next/hooks/use-consent-manager/overview): The primary hook for accessing consent state and actions. Returns the full consent store including all state properties and action methods. - [Checking Consent](https://c15t.com/docs/frameworks/next/hooks/use-consent-manager/checking-consent): Use has() for flexible consent checks with AND, OR, and NOT logic. Check if any consent exists with hasConsented(). - [Setting Consent](https://c15t.com/docs/frameworks/next/hooks/use-consent-manager/setting-consent): Save, update, and reset consent preferences with setConsent(), setSelectedConsent(), and saveConsents(). - [Location Info](https://c15t.com/docs/frameworks/next/hooks/use-consent-manager/location-info): Access detected jurisdiction, country, and region. Override geolocation for testing. - [useTranslations](https://c15t.com/docs/frameworks/next/hooks/use-translations): Access the current language's translations for building custom consent UI. - [useFocusTrap](https://c15t.com/docs/frameworks/next/hooks/use-focus-trap): Trap keyboard focus within a container for accessible modal dialogs. - [useColorScheme](https://c15t.com/docs/frameworks/next/hooks/use-color-scheme): Manage light/dark mode preferences for consent components. - [useReducedMotion](https://c15t.com/docs/frameworks/next/hooks/use-reduced-motion): Detect the user's prefers-reduced-motion OS setting and reactively disable animations. - [useTextDirection](https://c15t.com/docs/frameworks/next/hooks/use-text-direction): Manage RTL/LTR text direction based on the active language for consent UI. - [useSSRStatus](https://c15t.com/docs/frameworks/next/hooks/use-ssr-status): Check whether server-side rendered consent data was used during initialization. - [useDraggable](https://c15t.com/docs/frameworks/next/hooks/use-draggable): Make an element draggable between viewport corners with snapping, persistence, and animation support. - [Troubleshooting](https://c15t.com/docs/frameworks/next/troubleshooting): Solutions for common issues with @c15t/nextjs — provider errors, missing banners, consent persistence, and more. - [Building Headless Components](https://c15t.com/docs/frameworks/next/building-headless-components): Build policy-aware custom consent components in Next.js using the headless hooks and policy-pack tooling. - [Headless Mode](https://c15t.com/docs/frameworks/next/headless): Build fully custom consent UI using only hooks - no pre-built components required. - [IAB TCF 2.3](https://c15t.com/docs/frameworks/next/iab/overview): Implement IAB Transparency & Consent Framework 2.3 compliance for programmatic advertising in EU/EEA jurisdictions. - [IABConsentBanner](https://c15t.com/docs/frameworks/next/iab/consent-banner): An IAB TCF 2.3 compliant consent banner that displays partner count, purpose summaries, and legitimate interest notices. - [IABConsentDialog](https://c15t.com/docs/frameworks/next/iab/consent-dialog): An IAB TCF 2.3 compliant preference center with tabbed purpose and vendor management. - [useGVLData (Internal)](https://c15t.com/docs/frameworks/next/iab/use-gvl-data): Status note for the internal GVL hook used by the built-in IAB dialog. - [Overview](https://c15t.com/docs/cli/overview): The c15t CLI scaffolds, migrates, and configures consent management in your project. - [Quickstart](https://c15t.com/docs/cli/quickstart): Scaffold consent management into a React or Next.js app in under 2 minutes. - [setup](https://c15t.com/docs/cli/commands/setup): Interactive scaffolder that installs packages and adds consent components to your project. - [generate](https://c15t.com/docs/cli/commands/generate): Generate consent schema and code for your project. - [codemods](https://c15t.com/docs/cli/commands/codemods): Migrate code between c15t versions automatically. - [self-host](https://c15t.com/docs/cli/commands/self-host): Workflow commands for self-hosted @c15t/backend deployments. - [skills](https://c15t.com/docs/cli/commands/skills): Install c15t agent skills for AI-assisted development. - [login & logout](https://c15t.com/docs/cli/commands/auth): Authenticate the CLI with your hosted c15t account on inth.com. - [Global flags](https://c15t.com/docs/cli/global-flags): Flags that work on every CLI command. - [Telemetry](https://c15t.com/docs/cli/telemetry): What the CLI collects, why, and how to disable it. - [Integrations](https://c15t.com/docs/integrations/overview): Load analytics, pixels, tag managers, and widgets through c15t so consent state controls when they run, update, and appear in your consent UI. - [Build a Custom Script Integration](https://c15t.com/docs/integrations/building-integrations): Learn when to use a raw Script, when to build a reusable manifest-backed integration, and how to debug and test custom consent-aware scripts in c15t. - [Google Maps](https://c15t.com/docs/integrations/google-maps): Render Google Maps only after consent with one shared Maps JavaScript API loader and independently managed map instances. - [YouTube](https://c15t.com/docs/integrations/youtube): Keep YouTube iframes unmounted until consent with a privacy-enhanced, lazy-loaded React or Next.js embed. - [Google Tag Manager](https://c15t.com/docs/integrations/google-tag-manager): Deploy and manage marketing tags centrally with automatic consent state synchronization. - [GA4 + Google Ads (gtag.js)](https://c15t.com/docs/integrations/google-tag): Send data to Google Analytics 4 and Google Ads with automatic Consent Mode v2 support. - [Ahrefs Analytics](https://c15t.com/docs/integrations/ahrefs-analytics): Cookieless web analytics from Ahrefs with a prebuilt helper that wires the project key into a c15t-managed script. - [Adobe Analytics](https://c15t.com/docs/integrations/adobe-analytics): Adobe Analytics loaded through an Adobe Experience Platform Data Collection Tags embed URL. - [Amplitude](https://c15t.com/docs/integrations/amplitude): Load Amplitude Browser SDK 2 with c15t and gate product analytics behind measurement consent. - [Cloudflare Web Analytics](https://c15t.com/docs/integrations/cloudflare-web-analytics): Cookieless analytics from Cloudflare with a prebuilt helper that serializes the beacon config into the `data-cf-beacon` attribute. - [Clearbit](https://c15t.com/docs/integrations/clearbit): Visitor and company enrichment loaded with Clearbit's account-keyed tags.js snippet. - [Microsoft Clarity](https://c15t.com/docs/integrations/microsoft-clarity): Session replay and behavior analytics with a prebuilt helper that keeps Clarity consent synchronized with c15t measurement state. - [Databuddy](https://c15t.com/docs/integrations/databuddy): Databuddy is a privacy-focused analytics platform that helps you understand user behavior and track events. It supports cookieless tracking and manages consent automatically through c15t's consent state synchronization. - [Fathom Analytics](https://c15t.com/docs/integrations/fathom-analytics): Privacy-friendly cookieless analytics with a prebuilt helper that maps Fathom's data attributes into a c15t-managed script. - [Heap](https://c15t.com/docs/integrations/heap): Load Heap with c15t and gate autocapture product analytics behind measurement consent. - [Matomo Analytics](https://c15t.com/docs/integrations/matomo-analytics): Load Matomo with c15t and keep Matomo's queue aligned with measurement consent. - [Mixpanel Analytics](https://c15t.com/docs/integrations/mixpanel-analytics): Load Mixpanel with c15t and let Mixpanel's own opt-in and opt-out APIs follow measurement consent. - [Hotjar](https://c15t.com/docs/integrations/hotjar): Product analytics and behavior insights with a prebuilt helper that seeds Hotjar globals before loading the vendor bundle. - [Hightouch](https://c15t.com/docs/integrations/hightouch): Load Hightouch Events with c15t and gate the browser SDK behind measurement consent. - [LogRocket](https://c15t.com/docs/integrations/logrocket): Session replay and monitoring loaded after measurement consent with LogRocket's browser SDK. - [Plausible Analytics](https://c15t.com/docs/integrations/plausible-analytics): Privacy-friendly cookieless analytics with a prebuilt helper that preserves Plausible's queue bootstrap and loader attributes. - [PostHog](https://c15t.com/docs/integrations/posthog): PostHog is an open-source product analytics platform for tracking user behavior, session replays, feature flags, and A/B testing. It supports cookieless tracking, allowing analytics to continue even without cookie consent. - [Promptwatch](https://c15t.com/docs/integrations/promptwatch): Promptwatch analyzes traffic on your site for Artificial Intelligence (AI) traffic and usage insights. Data is stored in the EU without user-identifiable information. - [Pirsch](https://c15t.com/docs/integrations/pirsch): Privacy-friendly, cookieless analytics loaded with Pirsch's fixed script id and identification-code attributes. - [RudderStack](https://c15t.com/docs/integrations/rudderstack): Load RudderStack's JavaScript SDK with c15t and gate the browser SDK behind measurement consent. - [Segment](https://c15t.com/docs/integrations/segment): Load Segment Analytics.js with c15t and gate it behind measurement consent. - [Rybbit Analytics](https://c15t.com/docs/integrations/rybbit-analytics): Privacy-friendly analytics with script-tag configuration via Rybbit's data attributes. - [Umami Analytics](https://c15t.com/docs/integrations/umami-analytics): Open-source, cookieless analytics with a prebuilt helper that maps Umami's data attributes into a c15t-managed script. - [Vercel Analytics](https://c15t.com/docs/integrations/vercel-analytics): Bootstrap Vercel Analytics with a declarative queue and script attributes. - [Crisp](https://c15t.com/docs/integrations/crisp): Load Crisp live chat with website ID, runtime, cookie, and session options. - [Intercom](https://c15t.com/docs/integrations/intercom): Bootstrap Intercom settings and load the messenger widget bundle. - [Meta Pixel](https://c15t.com/docs/integrations/meta-pixel): Track conversions and build audiences for Facebook and Instagram advertising campaigns. - [Reddit Pixel](https://c15t.com/docs/integrations/reddit-pixel): Track conversions and build retargeting audiences for Reddit advertising campaigns. - [TikTok Pixel](https://c15t.com/docs/integrations/tiktok-pixel): Measure ad performance and build audiences for TikTok advertising campaigns. - [LinkedIn Insights](https://c15t.com/docs/integrations/linkedin-insights): Track conversions and build matched audiences for LinkedIn advertising campaigns. - [Microsoft UET](https://c15t.com/docs/integrations/microsoft-uet): Track conversions and measure performance for Microsoft Advertising and Bing Ads. - [Snapchat Pixel](https://c15t.com/docs/integrations/snapchat-pixel): Measure Snapchat ad performance and build remarketing audiences with a prebuilt pixel helper. - [X Pixel (Twitter Pixel)](https://c15t.com/docs/integrations/x-pixel): Track conversions and build audiences for advertising campaigns on X (formerly Twitter). - [Quickstart](https://c15t.com/docs/self-host/quickstart): Self-host the c15t consent management backend in your own infrastructure. - [Database Setup](https://c15t.com/docs/self-host/guides/database-setup): Configure a database adapter for your self-hosted c15t backend. - [Framework Integration](https://c15t.com/docs/self-host/guides/framework-integration): Mount the c15t consent backend in any JavaScript framework or runtime. - [Edge Deployment](https://c15t.com/docs/self-host/guides/edge-deployment): Run consent policy resolution at the edge for faster initial banner loads. - [Caching](https://c15t.com/docs/self-host/guides/caching): Add a caching layer to your self-hosted c15t backend for production performance. - [IAB TCF Support](https://c15t.com/docs/self-host/guides/iab-tcf): Enable IAB Transparency and Consent Framework (TCF) support in your self-hosted backend. - [Policy Packs](https://c15t.com/docs/self-host/guides/policy-packs): Configure regional policy packs on the backend and return deterministic runtime policy decisions from /init. - [Observability](https://c15t.com/docs/self-host/guides/observability): Add logging, metrics, and tracing to your self-hosted c15t backend. - [API Endpoints](https://c15t.com/docs/self-host/api/endpoints): Full reference for every c15t consent backend endpoint. - [Configuration Reference](https://c15t.com/docs/self-host/api/configuration): Complete reference for all c15t backend configuration options. - [Contributing](https://c15t.com/docs/contributing): Entry point for Contributing documentation. - [Docs Preview GitHub Action](https://c15t.com/docs/contributing/docs-preview-action): How our composite GitHub Action deploys the docs preview to Vercel and posts a sticky PR comment. - [Documentation System Setup](https://c15t.com/docs/contributing/documentation-setup): Learn how to set up the unified documentation build system for local development and understand the production deployment process. - [Building Privacy Tools in the Open](https://c15t.com/docs/oss/why-open-source): We believe great developer tools should be built in the open, with transparency and community collaboration at their core. This philosophy guides how we're building modern privacy infrastructure. - [Contributing to c15t.com](https://c15t.com/docs/oss/contributing): Entry point for Contributing to c15t.com documentation. - [c15t Community Code of Conduct](https://c15t.com/docs/oss/code-of-conduct): Guidelines for fostering an inclusive, respectful, and collaborative open-source community - [License](https://c15t.com/docs/oss/license): Apache License 2.0 applies to c15t open source packages and this repository. - [Cookie Policy](https://c15t.com/docs/legals/cookie-policy): Entry point for Cookie Policy documentation. - [Privacy Policy](https://c15t.com/docs/legals/privacy-policy): Entry point for Privacy Policy documentation. - [v2.2.0 - Consent-Aware Embeds, Configurable Controls, and More Integrations](https://c15t.com/changelog/2.2.0): Minor release adding consent-aware Google Maps and YouTube components, a configurable consent controls toolbar, eight script integrations, a reusable SDK hook, policy-aware action styling, CSP nonce support, reliability fixes, and new translations. - [v1.1.1 — Bundle Reduction Update](https://c15t.com/changelog/2025-04-24-v1.1.1): Performance-focused release achieving a massive 58.9% bundle size reduction while introducing a new headless package for custom implementations. Removed framer-motion and Tailwind variants for faster load times with zero UX compromise. - [v1.1.2 — Optimistic UI & Bundle Optimization](https://c15t.com/changelog/2025-04-24-v1.1.2): Performance-focused release introducing optimistic UI updates for instant user feedback, massive 58.9% bundle size reduction, and a new headless package for custom implementations with improved event handling. - [v1.1.3 — Enhanced Theming & Callback Improvements](https://c15t.com/changelog/2025-04-29-v1.1.3): Major release introducing comprehensive theming support with dark/light/system detection, improved consent callbacks with structured data, and enhanced color scheme integration. Includes breaking changes for theme system and callback data structure. - [v1.1.4 — Translation System Fixes & Core Improvements](https://c15t.com/changelog/2025-04-30-v1.1.4): Patch release addressing critical translation functionality issues across core and react packages. Introduces better modularity, improved fallback behavior, comprehensive test coverage, and enhanced translation utility functions. - [v1.1.5 — Tailwind CSS v3 Compatibility & Style Fixes](https://c15t.com/changelog/2025-05-04-v1.1.5): Patch release fixing critical Tailwind CSS v3 compatibility issues by removing CSS layers and improving noStyle theme handling. Ensures proper style application and prevents conflicts with modern Tailwind configurations. - [v1.2.0 — Backend Architecture Overhaul & Translation System Refactor](https://c15t.com/changelog/2025-05-12-v1.2.0): Major release introducing a complete backend refactor to oRPC client/server architecture with OpenAPI support, CORS middleware, and streamlined translation system with common strings consolidation. Includes breaking changes for translation structure. - [v1.2.1 — API Architecture Hardening, Translations Cleanup, and Tailwind v3 Fix](https://c15t.com/changelog/2025-05-12-v1.2.1): Patch release refining the new API architecture with oRPC + OpenAPI, consolidating translations into common keys, fixing Tailwind v3 layer collision, and improving schema validation and configuration defaults. Introduces a type-safe Node.js SDK and centralized routing. - [v1.3.0 — Translations Package, SSR Consent, CLI Telemetry, and Next.js Restructure](https://c15t.com/changelog/2025-06-09-v1.3.0): Minor release introducing the new @c15t/translations package with 8 languages, server-side consent initialization, CLI telemetry and onboarding upgrades, and a Next.js package restructuring that removes middleware exports. Includes backend translation support, improved schemas, and infrastructure/tooling updates. - [v1.3.1 — Next.js Data Fetching Refinements, Docs Fixes, and zh Translations](https://c15t.com/changelog/2025-06-23-v1.3.1): Patch release refining Next.js initial data fetching in c15t mode, fixing quickstart links, improving core fallbacks, and adding Chinese (zh) translations. Includes dependency updates across packages. - [v1.3.2 — Next.js Relative URL Fix](https://c15t.com/changelog/2025-06-23-v1.3.2): Patch release fixing a relative URL error in the Next.js integration. - [v1.3.3 — GTM Support, CookieBanner Focus Toggle, Next.js URL Validation](https://c15t.com/changelog/2025-06-24-v1.3.3): Patch release adding Google Tag Manager support in core, allowing trapFocus={false} in CookieBanner, improving URL validation in Next.js, and updating React dependency. - [v1.4.0 — Ignore Geo, Provider DX, Store Config, A11y, CLI Fixes](https://c15t.com/changelog/2025-06-26-v1.4.0): Minor release improving developer experience with ignoreGeoLocation and consentCategories, adding a debug-friendly store config prop, enhancing accessibility, and fixing CLI onboarding issues. - [v1.4.1 — Next.js: Custom c15t Headers for Initial Fetch](https://c15t.com/changelog/2025-06-26-v1.4.1): Patch release adding custom c15t headers to Next.js initial data fetch, enabling backend provider overrides and more reliable initialization. - [v1.4.2 — Indonesian Translations, Provider Render Fixes, URL Normalization](https://c15t.com/changelog/2025-06-26-v1.4.2): Patch release adding Bahasa Indonesia translations, improving provider rendering to prevent duplicate requests, normalizing URLs to remove trailing slashes, correcting consent logic, and refining banner animations. Includes dependency updates, caching improvements, and expanded tests. - [v1.4.3 — Theme Inheritance Fixes for Provider-Scoped Themes](https://c15t.com/changelog/2025-06-26-v1.4.3): Patch release ensuring provider-level themes set in ConsentManagerProvider are correctly inherited by CookieBanner, ConsentManagerDialog, and ConsentManagerWidget for consistent styling. - [v1.4.4 — Theme Inheritance Stability and Maintenance Updates](https://c15t.com/changelog/2025-06-26-v1.4.4): Patch release fixing theme inheritance in ConsentManager and related components, plus dependency updates and stronger tests to prevent regressions. - [v1.5.0 — Next.js Pages Support, GDPR Button Order, Backend Enhancements](https://c15t.com/changelog/2025-06-27-v1.5.0): Minor release adding Next.js Pages Directory support and updating cookie banner button order for GDPR guidance, alongside backend and integration improvements. - [v1.6.0 – New Docs, Rebuilt Self-Hosting Backend, Better Callbacks, and More](https://c15t.com/changelog/2025-09-09-v1.6.0): Minor release with a rebuilt self-hosting backend, a brand new docs site, improved consent checking, and callback improvements. - [v1.6.1 - React Scroll Lock Fix](https://c15t.com/changelog/2025-09-18-v1.6.1): Patch release fixing a bug where the scroll lock persisted after the dialog has been dismissed. - [v1.7.0 - Script Loader & iFrame Blocking](https://c15t.com/changelog/2025-10-11-v1.7.0): Minor release with a new approach to script loader and iFrame blocking. - [v1.7.1 - CLI Improvements & Bug Fixes](https://c15t.com/changelog/2025-10-22-v1.7.1): Patch release with CLI improvements including bun support and bug fixes. - [v1.8.0 - Cross-Subdomain Consent, Legal Links, User Identification & EU Languages](https://c15t.com/changelog/2025-10-27-v1.8.0): Feature release adding cross-subdomain consent persistence via cookies, configurable legal links in components, user identification tracking, and comprehensive language support with all 24 EU official languages. - [v1.8.2 - React Bug Fixes](https://c15t.com/changelog/2025-12-12-v1.8.2): Patch release with bug fixes and improvements. - [v1.8.3 - Experimental Global Privacy Control Support & Bug Fixes](https://c15t.com/changelog/2026-01-19-v1.8.3): Patch release with experimental Global Privacy Control support and bug fixes. - [v2.0.0-rc.0 — New Styling System, IAB TCF, Dev Tools, Backend v2 & More](https://c15t.com/changelog/2026-02-12-v2.0.0-rc.0): Release candidate introducing a token-based styling system, IAB TCF 2.3 support, dev tools, backend v2, network blocker, GPC support and a complete documentation overhaul. - [v2.0.0-rc.5 — Policy Packs, Per-Policy GPC, Fallback Policies & Dev-Tools Improvements](https://c15t.com/changelog/2026-03-11-v2.0.0-rc.5): Release candidate introducing policy packs for regional consent resolution, per-policy GPC support, fallback policies, policy inspection, and developer-experience improvements. - [v2.0.0-rc.6 — Smaller Client Bundles, Modular IAB, UI Primitives, and Flexible Policy Actions](https://c15t.com/changelog/2026-04-06-v2.0.0-rc.6): Release candidate focused on smaller client bundles, extracted IAB support, shared UI primitives with framework adapters, flexible policy action layouts, and cleaner package styling/toolchain boundaries. - [v2.0.0-rc.7 — Theming Fixes, Simpler Tailwind Setup, and Clearer Customization Guidance](https://c15t.com/changelog/2026-04-08-v2.0.0-rc.7): Release candidate focused on fixing theming regressions in the prebuilt UI, simplifying the Tailwind setup contract, clarifying the recommended customization ladder, and adding better manual coverage for CSS behavior across Tailwind 3, Tailwind 4, and plain CSS. - [v2.0.0 - New Styling System, Policy Packs, Backend v2 & More](https://c15t.com/changelog/2026-04-14-v2.0.0): Stable release notes for c15t 2.0, covering the token-based styling system, policy packs, GPC, IAB TCF 2.3, bundled docs, c15t/skills, dev tools, backend v2, migration tooling, and the prebuilt UI. - [v2.0.1 - TanStack Devtools Support & Tailwind Import Ordering](https://c15t.com/changelog/2026-04-19-v2.0.1): Patch release adding official TanStack Devtools support for @c15t/dev-tools and improving Tailwind v4 stylesheet import ordering in the c15t CLI. - [v2.1.0 - Expanded Script Integrations and Provider Registry](https://c15t.com/changelog/2026-05-13-v2.1.0): Minor release expanding the consent-aware script loader with a registry-backed provider system, more prebuilt integrations, stronger lifecycle utilities, CLI discovery updates, and German translation refinements. - [Compare c15t](https://c15t.com/docs/comparison): Compare c15t with open-source consent libraries, React banners, and hosted CMPs such as OneTrust, Cookiebot by Usercentrics, Didomi, Usercentrics, and Osano. - [Compare c15t](https://c15t.com/docs/comparisons): Compare c15t with open-source consent libraries, React banners, and hosted CMPs such as OneTrust, Cookiebot by Usercentrics, Didomi, Usercentrics, and Osano. - [c15t vs Cookiebot](https://c15t.com/docs/comparisons/cookiebot): Compare c15t with Cookiebot by Usercentrics for cookie blocking, consent records, hosted CMP workflows, and app-owned consent state. - [c15t vs CookieConsent v3](https://c15t.com/docs/comparisons/cookieconsent-v3): Compare c15t with CookieConsent v3 for JavaScript consent, script gating, backend records, and framework-ready consent state. - [c15t vs Didomi](https://c15t.com/docs/comparisons/didomi): Compare c15t with Didomi for consent proofs, hosted platform workflows, records, and developer-owned framework integration. - [c15t vs Iubenda](https://c15t.com/docs/comparisons/iubenda): Compare c15t with Iubenda for cookie banners, CMP workflows, consent records, Google Consent Mode, and app-owned consent state. - [c15t vs Klaro!](https://c15t.com/docs/comparisons/klaro): Compare c15t with Klaro! for service-based consent, Google Consent Mode, backend records, and framework integration. - [c15t vs OneTrust](https://c15t.com/docs/comparisons/onetrust): Compare c15t with OneTrust for hosted CMP workflows, consent records, script control, and developer-owned app integration. - [c15t vs Osano](https://c15t.com/docs/comparisons/osano): Compare c15t with Osano CookieConsent and Osano's hosted CMP for developer-owned consent, records, policy, and app integration. - [c15t vs react-cookie-consent](https://c15t.com/docs/comparisons/react-cookie-consent): Compare c15t with react-cookie-consent for React banners, hooks, consent categories, script blocking, backend records, and app state. - [c15t vs Silktide Consent Manager](https://c15t.com/docs/comparisons/silktide-consent-manager): Compare c15t with Silktide Consent Manager for client-side banners, Google Consent Mode, framework APIs, and backend policy resolution. - [c15t vs tarteaucitron.js](https://c15t.com/docs/comparisons/tarteaucitron): Compare c15t with tarteaucitron.js for service catalogs, script loading, Consent Mode, backend records, and app-owned consent state. - [c15t vs Usercentrics](https://c15t.com/docs/comparisons/usercentrics): Compare c15t with Usercentrics Web CMP for hosted consent workflows, auto-blocking, regional rules, and app-integrated consent state. - [Client Modes](https://c15t.com/docs/shared/concepts/client-modes): Reference page for client modes. - [Consent Categories](https://c15t.com/docs/shared/concepts/consent-categories): Reference page for consent categories. - [Consent Models](https://c15t.com/docs/shared/concepts/consent-models): Reference page for consent models. - [Cookie Management](https://c15t.com/docs/shared/concepts/cookie-management): Reference page for cookie management. - [Glossary](https://c15t.com/docs/shared/concepts/glossary): Reference page for glossary. - [Initialization Flow](https://c15t.com/docs/shared/concepts/initialization-flow): Reference page for initialization flow. - [Policy Packs](https://c15t.com/docs/shared/concepts/policy-packs): Reference page for policy packs. - [Consent Banner](https://c15t.com/docs/shared/react/components/consent-banner): Reference page for consent banner. - [Consent Dialog](https://c15t.com/docs/shared/react/components/consent-dialog): Reference page for consent dialog. - [Consent Dialog Link](https://c15t.com/docs/shared/react/components/consent-dialog-link): Reference page for consent dialog link. - [Consent Dialog Trigger](https://c15t.com/docs/shared/react/components/consent-dialog-trigger): Reference page for consent dialog trigger. - [Consent Manager Provider](https://c15t.com/docs/shared/react/components/consent-manager-provider): Reference page for consent manager provider. - [Consent Widget](https://c15t.com/docs/shared/react/components/consent-widget): Reference page for consent widget. - [Dev Tools](https://c15t.com/docs/shared/react/components/dev-tools): Reference page for dev tools. - [Frame](https://c15t.com/docs/shared/react/components/frame): Reference page for frame. - [Building Headless Components](https://c15t.com/docs/shared/react/guides/building-headless-components): Reference page for building headless components. - [Callbacks](https://c15t.com/docs/shared/react/guides/callbacks): Reference page for callbacks. - [Headless](https://c15t.com/docs/shared/react/guides/headless): Reference page for headless. - [Iframe Blocking](https://c15t.com/docs/shared/react/guides/iframe-blocking): Reference page for iframe blocking. - [Internationalization](https://c15t.com/docs/shared/react/guides/internationalization): Reference page for internationalization. - [Network Blocker](https://c15t.com/docs/shared/react/guides/network-blocker): Reference page for network blocker. - [Optimization](https://c15t.com/docs/shared/react/guides/optimization): Reference page for optimization. - [Policy Packs](https://c15t.com/docs/shared/react/guides/policy-packs): Reference page for policy packs. - [Script Loader](https://c15t.com/docs/shared/react/guides/script-loader): Reference page for script loader. - [Use Color Scheme](https://c15t.com/docs/shared/react/hooks/use-color-scheme): Reference page for use color scheme. - [Checking Consent](https://c15t.com/docs/shared/react/hooks/use-consent-manager/checking-consent): Reference page for checking consent. - [Location Info](https://c15t.com/docs/shared/react/hooks/use-consent-manager/location-info): Reference page for location info. - [Overview](https://c15t.com/docs/shared/react/hooks/use-consent-manager/overview): Reference page for overview. - [Setting Consent](https://c15t.com/docs/shared/react/hooks/use-consent-manager/setting-consent): Reference page for setting consent. - [Use Draggable](https://c15t.com/docs/shared/react/hooks/use-draggable): Reference page for use draggable. - [Use Focus Trap](https://c15t.com/docs/shared/react/hooks/use-focus-trap): Reference page for use focus trap. - [Use Reduced Motion](https://c15t.com/docs/shared/react/hooks/use-reduced-motion): Reference page for use reduced motion. - [Use SSR Status](https://c15t.com/docs/shared/react/hooks/use-ssr-status): Reference page for use ssr status. - [Use Text Direction](https://c15t.com/docs/shared/react/hooks/use-text-direction): Reference page for use text direction. - [Use Translations](https://c15t.com/docs/shared/react/hooks/use-translations): Reference page for use translations. - [Consent Banner](https://c15t.com/docs/shared/react/iab/consent-banner): Reference page for consent banner. - [Consent Dialog](https://c15t.com/docs/shared/react/iab/consent-dialog): Reference page for consent dialog. - [Overview](https://c15t.com/docs/shared/react/iab/overview): Reference page for overview. - [Use GVL Data](https://c15t.com/docs/shared/react/iab/use-gvl-data): Reference page for use gvl data. - [Classnames](https://c15t.com/docs/shared/react/styling/classnames): Reference page for classnames. - [Color Scheme](https://c15t.com/docs/shared/react/styling/color-scheme): Reference page for color scheme. - [CSS Variables](https://c15t.com/docs/shared/react/styling/css-variables): Reference page for css variables. - [Overview](https://c15t.com/docs/shared/react/styling/overview): Reference page for overview. - [Slots](https://c15t.com/docs/shared/react/styling/slots): Reference page for slots. - [Stylesheet Entrypoint](https://c15t.com/docs/shared/react/styling/stylesheet-entrypoint): Reference page for stylesheet entrypoint. - [Tailwind](https://c15t.com/docs/shared/react/styling/tailwind): Reference page for tailwind. - [Tokens](https://c15t.com/docs/shared/react/styling/tokens): Reference page for tokens. - [Troubleshooting](https://c15t.com/docs/shared/troubleshooting): Reference page for troubleshooting. ## Content # Frameworks URL: https://c15t.com/docs/frameworks Reference page for frameworks. * [React](/docs/frameworks/react/quickstart) * [JavaScript](/docs/frameworks/javascript/quickstart) * [Next.js](/docs/frameworks/next/quickstart) # Quickstart URL: https://c15t.com/docs/frameworks/react/quickstart Add consent management to your React app in under 5 minutes. ## Via CLI ## Manual Installation 1. **Install package** 2. **Import styles** Import the prebuilt component stylesheet in your app-level CSS entrypoint. This is required for styled components to render correctly. ```css @import "@c15t/react/styles.css"; ``` Keeping the c15t stylesheet in your global CSS entrypoint makes layer and cascade order explicit. JS/TSX side-effect imports can load in a different order across framework and Tailwind tooling, which makes style regressions harder to debug.With Tailwind v4, keep c15t at the end of the top-level @import block so Fumadocs, tw-animate-css, and other preset imports do not override c15t theme tokens. > ℹ️ Info: > If you are using the headless API or fully custom styling, you can skip this import. src/main.tsx should keep importing ./index.css as usual. 3. **Create ConsentManager components** Create a provider component with the consent UI and a wrapper that re-exports it. This initializes the consent store and makes consent state available to all child components. ```tsx 'use client'; import { type ReactNode } from 'react'; import { ConsentManagerProvider, ConsentBanner, ConsentDialog } from '@c15t/react'; export default function ConsentManagerClient({ children }: { children: ReactNode }) { return ( {children} ); } ``` ```tsx import type { ReactNode } from 'react'; import ConsentManagerProvider from './provider'; export function ConsentManager({ children }: { children: ReactNode }) { return {children}; } ``` > ℹ️ Info: > Hosted mode is the recommended production setup because the backend resolves jurisdiction and policy, keeps durable consent records, and lets c15t recover from temporary network failures by re-syncing later. > > ⚠️ Warning: > Don't have a backend yet? You can use mode: 'offline' for local-only consent storage, but it gives up backend audit history, server-side consent awareness, and automatic jurisdiction detection. Review the browser-only storage consequences before choosing it for production. 4. **Mount ConsentManager at the app root** Wrap your existing app tree with `ConsentManager` so all routes/components can access consent state. ```tsx import { ConsentManager } from './components/consent-manager'; export default function App() { return ( {/* your existing app */} ); } ``` 5. **Verify it works** Start your development server and confirm: 1. A **consent banner** appears at the bottom of the page 2. Clicking **"Customize"** opens a dialog with toggles for each consent category 3. After accepting or rejecting, the banner dismisses and your choice persists across page reloads > ℹ️ **Info:** > Want to improve startup performance? See Optimization for the decision guide, prefetch setup, and network tuning. ## Optional: Add DevTools Install DevTools only if you want a runtime inspector while building and debugging: Then add it inside your existing provider: ```tsx title="components/consent-manager/provider.tsx" import { DevTools } from '@c15t/dev-tools/react'; // ... {process.env.NODE_ENV !== 'production' && } {children} ``` > ℹ️ **Info:** > Want to understand what's happening under the hood? See Initialization Flow for the lifecycle and Cookie Management for script/cookie behavior and revocation handling. ## Optional: AI Agents Install c15t agent skills to let AI agents help with styling, i18n, scripts & other configuration. See [AI Agents](/docs/ai-agents) for bundled package docs and agent skills. ## Next steps * [Optimization](/docs/frameworks/react/optimization) * [Script Loader](/docs/frameworks/react/script-loader) * [Styling](/docs/frameworks/react/styling/overview) * [Consent Categories](/docs/frameworks/react/concepts/consent-categories) * [Components](/docs/frameworks/react/components/consent-banner) * [AI Agents](/docs/ai-agents) # Optimization URL: https://c15t.com/docs/frameworks/react/optimization Improve c15t startup performance in React with prefetching, proxy rewrites, and rendering tradeoffs. Use this guide when you care about banner visibility speed, route static-ness, and reducing backend round-trip cost. ## Start Here Apply the optimizations in this order: |Situation|Use|Why|Tradeoff| |--|--|--|--| |Any production app using hosted mode|Same-origin `/api/c15t` proxy|Lowers browser startup overhead and keeps the backend origin out of client config|Requires framework or platform proxy setup| |Banner speed matters on cold loads|`buildPrefetchScript()`|Starts `/init` before your app hydrates|Still a browser-side fetch, not SSR| |Your app navigates client-side|Keep the provider mounted at the app root|Avoids remounting and re-running init work|Requires provider placement discipline| |You cannot proxy and must stay cross-origin|``|Starts DNS/TLS work earlier|Smaller gain than same-origin proxying| |You are using Next.js and want SSR or static-route-specific guidance|Next.js optimization docs|Covers `C15tPrefetch`, `fetchInitialData()`, and rendering tradeoffs|Next-specific| > ℹ️ **Info:** > Treat same-origin proxying as the baseline optimization. The others are situational layers you add when startup timing or route behavior justifies them. ## 1) Prefer Same-Origin Proxy Proxy c15t requests through your app server so the browser calls your own origin instead of a third-party domain. How you configure this depends on your framework — Vite has `server.proxy`, Remix has resource routes, and most deployment platforms support rewrite rules. Then use: ```tsx ``` Why this helps: * Same-origin requests avoid extra DNS/TLS setup in many deployments * Ad blockers are less likely to block your init endpoint * You can change backend infrastructure without touching client code If you can only do one optimization, do this one first. ## 2) Prefetch Init Data Early Use `buildPrefetchScript()` from the `c15t` core package to start the `/init` request before your app hydrates. Inject the script as early as possible in your HTML ``. In production benchmarks with a same-origin rewrite, prefetching strategies show measurable improvement over client-only init: |Strategy|Scripts loaded|Data request starts|Banner visible| |--|--|--|--| |Client-only (no prefetch)|baseline|baseline|baseline| |Browser prefetch|\~1.3x faster|\~2.6x earlier|\~1.25x faster| |Server prefetch|\~2x faster|before page loads|\~1.9x faster| Use this when: * The app is client-rendered * You want a faster first banner without introducing SSR complexity * You control the HTML template or document `` ### Inline Script Prefetch ```tsx import { buildPrefetchScript } from 'c15t'; const prefetchScript = buildPrefetchScript({ backendURL: '/api/c15t', }); // In your HTML template or root component: