@c15t/react 2.0.4 → 2.2.0-canary-20260727202135

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (332) hide show
  1. package/AGENTS.md +155 -0
  2. package/README.md +29 -14
  3. package/client/components/integrations.js +3 -0
  4. package/dist/components/consent-banner/atoms/overlay.cjs +1 -1
  5. package/dist/components/consent-banner/atoms/root.cjs +1 -1
  6. package/dist/components/consent-banner/components.cjs +1 -1
  7. package/dist/components/consent-banner/consent-banner.cjs +1 -1
  8. package/dist/components/consent-banner/error-boundary.cjs +1 -1
  9. package/dist/components/consent-banner/index.cjs +1 -1
  10. package/dist/components/consent-banner/policy-actions.cjs +1 -1
  11. package/dist/components/consent-dialog/atoms/card.cjs +1 -1
  12. package/dist/components/consent-dialog/atoms/overlay.cjs +1 -1
  13. package/dist/components/consent-dialog/atoms/root.cjs +1 -1
  14. package/dist/components/consent-dialog/consent-dialog.cjs +1 -1
  15. package/dist/components/consent-dialog/index.cjs +1 -1
  16. package/dist/components/consent-dialog-link/index.cjs +1 -1
  17. package/dist/components/consent-dialog-trigger/atoms/button.cjs +1 -1
  18. package/dist/components/consent-dialog-trigger/atoms/button.js +1 -1
  19. package/dist/components/consent-dialog-trigger/atoms/icon.cjs +1 -1
  20. package/dist/components/consent-dialog-trigger/atoms/root.cjs +1 -1
  21. package/dist/components/consent-dialog-trigger/atoms/text.cjs +1 -1
  22. package/dist/components/consent-dialog-trigger/atoms/toolbar.cjs +1 -0
  23. package/dist/components/consent-dialog-trigger/atoms/toolbar.js +1 -0
  24. package/dist/components/consent-dialog-trigger/consent-dialog-trigger-toolbar.cjs +1 -0
  25. package/dist/components/consent-dialog-trigger/consent-dialog-trigger-toolbar.js +1 -0
  26. package/dist/components/consent-dialog-trigger/consent-dialog-trigger.cjs +1 -1
  27. package/dist/components/consent-dialog-trigger/index.cjs +1 -1
  28. package/dist/components/consent-dialog-trigger/index.js +1 -1
  29. package/dist/components/consent-dialog-trigger/use-draggable.cjs +1 -1
  30. package/dist/components/consent-preferences-link/consent-preferences-link.cjs +1 -1
  31. package/dist/components/consent-preferences-link/index.cjs +1 -1
  32. package/dist/components/consent-widget/atoms/accordion.cjs +1 -1
  33. package/dist/components/consent-widget/atoms/button.cjs +1 -1
  34. package/dist/components/consent-widget/atoms/footer.cjs +1 -1
  35. package/dist/components/consent-widget/atoms/root.cjs +1 -1
  36. package/dist/components/consent-widget/consent-widget.cjs +1 -1
  37. package/dist/components/consent-widget/index.cjs +1 -1
  38. package/dist/components/consent-widget/policy-actions.cjs +1 -1
  39. package/dist/components/frame/atoms.cjs +1 -1
  40. package/dist/components/frame/atoms.js +1 -1
  41. package/dist/components/frame/frame.cjs +1 -1
  42. package/dist/components/frame/index.cjs +1 -1
  43. package/dist/components/iab-consent-banner/atoms/button-group.cjs +1 -1
  44. package/dist/components/iab-consent-banner/atoms/card.cjs +1 -1
  45. package/dist/components/iab-consent-banner/atoms/description.cjs +1 -1
  46. package/dist/components/iab-consent-banner/atoms/footer.cjs +1 -1
  47. package/dist/components/iab-consent-banner/atoms/header.cjs +1 -1
  48. package/dist/components/iab-consent-banner/atoms/overlay.cjs +1 -1
  49. package/dist/components/iab-consent-banner/atoms/root.cjs +1 -1
  50. package/dist/components/iab-consent-banner/atoms/title.cjs +1 -1
  51. package/dist/components/iab-consent-banner/iab-consent-banner.cjs +1 -1
  52. package/dist/components/iab-consent-banner/iab-consent-banner.js +1 -1
  53. package/dist/components/iab-consent-banner/index.cjs +1 -1
  54. package/dist/components/iab-consent-dialog/atoms/card.cjs +1 -1
  55. package/dist/components/iab-consent-dialog/atoms/content.cjs +1 -1
  56. package/dist/components/iab-consent-dialog/atoms/footer.cjs +1 -1
  57. package/dist/components/iab-consent-dialog/atoms/header.cjs +1 -1
  58. package/dist/components/iab-consent-dialog/atoms/overlay.cjs +1 -1
  59. package/dist/components/iab-consent-dialog/atoms/purpose-item.cjs +1 -1
  60. package/dist/components/iab-consent-dialog/atoms/root.cjs +1 -1
  61. package/dist/components/iab-consent-dialog/atoms/stack-item.cjs +1 -1
  62. package/dist/components/iab-consent-dialog/atoms/tabs.cjs +1 -1
  63. package/dist/components/iab-consent-dialog/atoms/vendor-list.cjs +1 -1
  64. package/dist/components/iab-consent-dialog/hooks/use-gvl-data.cjs +1 -1
  65. package/dist/components/iab-consent-dialog/iab-consent-dialog.cjs +1 -1
  66. package/dist/components/iab-consent-dialog/index.cjs +1 -1
  67. package/dist/components/iab-consent-dialog/use-iab-translations.cjs +1 -1
  68. package/dist/components/integrations/google-map.cjs +1 -0
  69. package/dist/components/integrations/google-map.js +1 -0
  70. package/dist/components/integrations/index.cjs +1 -0
  71. package/dist/components/integrations/index.js +1 -0
  72. package/dist/components/integrations/shared.cjs +1 -0
  73. package/dist/components/integrations/shared.js +1 -0
  74. package/dist/components/integrations/youtube-embed.cjs +1 -0
  75. package/dist/components/integrations/youtube-embed.js +1 -0
  76. package/dist/components/shared/libs/recursive-clone-children.cjs +1 -1
  77. package/dist/components/shared/libs/slot.cjs +1 -1
  78. package/dist/components/shared/libs/use-controllable-state.cjs +1 -1
  79. package/dist/components/shared/policy-actions.cjs +1 -1
  80. package/dist/components/shared/primitives/box.cjs +1 -1
  81. package/dist/components/shared/primitives/button.cjs +1 -1
  82. package/dist/components/shared/primitives/button.js +1 -1
  83. package/dist/components/shared/primitives/legal-links/index.cjs +1 -1
  84. package/dist/components/shared/primitives/legal-links/index.js +1 -1
  85. package/dist/components/shared/ui/accordion/accordion.cjs +1 -1
  86. package/dist/components/shared/ui/accordion/index.cjs +1 -1
  87. package/dist/components/shared/ui/animated-collapse/animated-collapse.cjs +1 -1
  88. package/dist/components/shared/ui/animated-collapse/index.cjs +1 -1
  89. package/dist/components/shared/ui/branding.cjs +1 -1
  90. package/dist/components/shared/ui/button/button.cjs +1 -1
  91. package/dist/components/shared/ui/button/index.cjs +1 -1
  92. package/dist/components/shared/ui/collapsible/collapsible.cjs +1 -1
  93. package/dist/components/shared/ui/collapsible/index.cjs +1 -1
  94. package/dist/components/shared/ui/dialog/dialog.cjs +1 -1
  95. package/dist/components/shared/ui/dialog/index.cjs +1 -1
  96. package/dist/components/shared/ui/icon.cjs +1 -1
  97. package/dist/components/shared/ui/logo.cjs +1 -1
  98. package/dist/components/shared/ui/preference-item/index.cjs +1 -1
  99. package/dist/components/shared/ui/preference-item/preference-item.cjs +1 -1
  100. package/dist/components/shared/ui/switch/index.cjs +1 -1
  101. package/dist/components/shared/ui/switch/switch.cjs +1 -1
  102. package/dist/components/shared/ui/tabs/index.cjs +1 -1
  103. package/dist/components/shared/ui/tabs/tabs.cjs +1 -1
  104. package/dist/context/consent-manager-context.cjs +1 -1
  105. package/dist/context/consent-tracking-context.cjs +1 -1
  106. package/dist/context/theme-context.cjs +1 -1
  107. package/dist/headless.cjs +1 -1
  108. package/dist/headless.js +1 -1
  109. package/dist/hooks/index.cjs +1 -1
  110. package/dist/hooks/index.js +1 -1
  111. package/dist/hooks/use-color-scheme.cjs +1 -1
  112. package/dist/hooks/use-component-config.cjs +1 -1
  113. package/dist/hooks/use-consent-dialog-trigger.cjs +1 -1
  114. package/dist/hooks/use-consent-manager.cjs +1 -1
  115. package/dist/hooks/use-consent-script.cjs +1 -0
  116. package/dist/hooks/use-consent-script.js +1 -0
  117. package/dist/hooks/use-focus-trap.cjs +1 -1
  118. package/dist/hooks/use-headless-consent-ui.cjs +1 -1
  119. package/dist/hooks/use-headless-iab-consent-ui.cjs +1 -1
  120. package/dist/hooks/use-reduced-motion.cjs +1 -1
  121. package/dist/hooks/use-scroll-lock.cjs +1 -1
  122. package/dist/hooks/use-ssr-status.cjs +1 -1
  123. package/dist/hooks/use-styles.cjs +1 -1
  124. package/dist/hooks/use-text-direction.cjs +1 -1
  125. package/dist/hooks/use-theme.cjs +1 -1
  126. package/dist/hooks/use-translations.cjs +1 -1
  127. package/dist/iab.cjs +1 -1
  128. package/dist/index.cjs +1 -1
  129. package/dist/index.js +1 -1
  130. package/dist/primitives/accordion.cjs +1 -1
  131. package/dist/primitives/button.cjs +1 -1
  132. package/dist/primitives/collapsible.cjs +1 -1
  133. package/dist/primitives/dialog.cjs +1 -1
  134. package/dist/primitives/preference-item.cjs +1 -1
  135. package/dist/primitives/switch.cjs +1 -1
  136. package/dist/primitives/tabs.cjs +1 -1
  137. package/dist/primitives.cjs +1 -1
  138. package/dist/providers/consent-manager-provider.cjs +1 -1
  139. package/dist/server/fetch-ssr-data.cjs +1 -1
  140. package/dist/server/fetch-ssr-data.js +1 -1
  141. package/dist/server/headers.cjs +1 -1
  142. package/dist/server/headers.js +1 -1
  143. package/dist/server/index.cjs +1 -1
  144. package/dist/server/init-cache-key.cjs +1 -1
  145. package/dist/server/normalize-url.cjs +1 -1
  146. package/dist/styles.tw3.css +1 -1
  147. package/dist/types/theme/index.cjs +1 -1
  148. package/dist/types/theme/style-types.cjs +1 -1
  149. package/dist/utils/cn.cjs +1 -1
  150. package/dist/utils/merge-styles.cjs +1 -1
  151. package/dist/utils/test-helpers.cjs +1 -1
  152. package/dist/utils/theme-utils.cjs +1 -1
  153. package/dist/version.cjs +1 -1
  154. package/dist/version.js +1 -1
  155. package/dist-types/components/consent-banner/components.d.ts +2 -2
  156. package/dist-types/components/consent-banner/policy-actions.d.ts +1 -1
  157. package/dist-types/components/consent-dialog/atoms/card.d.ts +5 -5
  158. package/dist-types/components/consent-dialog-trigger/atoms/toolbar.d.ts +22 -0
  159. package/dist-types/components/consent-dialog-trigger/consent-dialog-trigger-toolbar.d.ts +35 -0
  160. package/dist-types/components/consent-dialog-trigger/index.d.ts +2 -1
  161. package/dist-types/components/consent-dialog-trigger/types.d.ts +111 -6
  162. package/dist-types/components/consent-widget/atoms/accordion.d.ts +4 -4
  163. package/dist-types/components/consent-widget/consent-widget.d.ts +1 -1
  164. package/dist-types/components/consent-widget/policy-actions.d.ts +1 -1
  165. package/dist-types/components/integrations/google-map.d.ts +82 -0
  166. package/dist-types/components/integrations/index.d.ts +2 -0
  167. package/dist-types/components/integrations/shared.d.ts +12 -0
  168. package/dist-types/components/integrations/youtube-embed.d.ts +95 -0
  169. package/dist-types/components/shared/policy-actions.d.ts +1 -1
  170. package/dist-types/components/shared/primitives/button.d.ts +36 -2
  171. package/dist-types/components/shared/primitives/legal-links/index.d.ts +1 -1
  172. package/dist-types/components/shared/ui/accordion/accordion.d.ts +2 -2
  173. package/dist-types/components/shared/ui/branding.d.ts +3 -3
  174. package/dist-types/components/shared/ui/button/button.d.ts +1 -1
  175. package/dist-types/components/shared/ui/dialog/dialog.d.ts +1 -1
  176. package/dist-types/components/shared/ui/logo.d.ts +8 -8
  177. package/dist-types/headless.d.ts +1 -0
  178. package/dist-types/hooks/index.d.ts +1 -0
  179. package/dist-types/hooks/use-consent-script.d.ts +80 -0
  180. package/dist-types/index.d.ts +3 -1
  181. package/dist-types/providers/consent-manager-provider.d.ts +1 -1
  182. package/dist-types/server/headers.d.ts +1 -1
  183. package/dist-types/utils/theme-utils.d.ts +1 -1
  184. package/dist-types/version.d.ts +1 -1
  185. package/docs/README.md +155 -76
  186. package/docs/{building-headless-components.md → frameworks/react/building-headless-components.md} +3 -1
  187. package/docs/{callbacks.md → frameworks/react/callbacks.md} +3 -1
  188. package/docs/{components → frameworks/react/components}/consent-banner.md +10 -21
  189. package/docs/{components → frameworks/react/components}/consent-dialog-link.md +8 -5
  190. package/docs/frameworks/react/components/consent-dialog-trigger.md +202 -0
  191. package/docs/{components → frameworks/react/components}/consent-dialog.md +7 -15
  192. package/docs/frameworks/react/components/consent-manager-provider.md +228 -0
  193. package/docs/{components → frameworks/react/components}/consent-widget.md +8 -6
  194. package/docs/{components → frameworks/react/components}/dev-tools.md +9 -6
  195. package/docs/{components → frameworks/react/components}/frame.md +8 -9
  196. package/docs/{concepts → frameworks/react/concepts}/client-modes.md +4 -2
  197. package/docs/{concepts → frameworks/react/concepts}/consent-categories.md +1 -0
  198. package/docs/{concepts → frameworks/react/concepts}/consent-models.md +1 -0
  199. package/docs/{concepts → frameworks/react/concepts}/cookie-management.md +3 -3
  200. package/docs/{concepts → frameworks/react/concepts}/glossary.md +1 -0
  201. package/docs/{concepts → frameworks/react/concepts}/initialization-flow.md +1 -0
  202. package/docs/{concepts → frameworks/react/concepts}/policy-packs.md +1 -0
  203. package/docs/{headless.md → frameworks/react/headless.md} +3 -1
  204. package/docs/{hooks → frameworks/react/hooks}/use-color-scheme.md +1 -0
  205. package/docs/{hooks → frameworks/react/hooks}/use-consent-manager/checking-consent.md +3 -1
  206. package/docs/{hooks → frameworks/react/hooks}/use-consent-manager/location-info.md +3 -1
  207. package/docs/frameworks/react/hooks/use-consent-manager/overview.md +172 -0
  208. package/docs/{hooks → frameworks/react/hooks}/use-consent-manager/setting-consent.md +3 -1
  209. package/docs/{hooks → frameworks/react/hooks}/use-draggable.md +3 -1
  210. package/docs/{hooks → frameworks/react/hooks}/use-focus-trap.md +1 -0
  211. package/docs/{hooks → frameworks/react/hooks}/use-reduced-motion.md +3 -1
  212. package/docs/{hooks → frameworks/react/hooks}/use-ssr-status.md +6 -5
  213. package/docs/{hooks → frameworks/react/hooks}/use-text-direction.md +1 -0
  214. package/docs/frameworks/react/hooks/use-translations.md +55 -0
  215. package/docs/{iab → frameworks/react/iab}/consent-banner.md +9 -12
  216. package/docs/{iab → frameworks/react/iab}/consent-dialog.md +9 -14
  217. package/docs/{iab → frameworks/react/iab}/overview.md +4 -2
  218. package/docs/{iab → frameworks/react/iab}/use-gvl-data.md +3 -2
  219. package/docs/{iframe-blocking.md → frameworks/react/iframe-blocking.md} +8 -9
  220. package/docs/{internationalization.md → frameworks/react/internationalization.md} +13 -3
  221. package/docs/{network-blocker.md → frameworks/react/network-blocker.md} +13 -51
  222. package/docs/{optimization.md → frameworks/react/optimization.md} +3 -2
  223. package/docs/{policy-packs.md → frameworks/react/policy-packs.md} +3 -1
  224. package/docs/{quickstart.md → frameworks/react/quickstart.md} +26 -42
  225. package/docs/frameworks/react/script-loader.md +553 -0
  226. package/docs/{server-side.md → frameworks/react/server-side.md} +9 -4
  227. package/docs/{styling → frameworks/react/styling}/classnames.md +3 -1
  228. package/docs/{styling → frameworks/react/styling}/color-scheme.md +3 -1
  229. package/docs/frameworks/react/styling/css-variables.md +53 -0
  230. package/docs/frameworks/react/styling/overview.md +302 -0
  231. package/docs/frameworks/react/styling/slots.md +94 -0
  232. package/docs/{styling → frameworks/react/styling}/tailwind.md +3 -1
  233. package/docs/frameworks/react/styling/tokens.md +156 -0
  234. package/docs/{troubleshooting.md → frameworks/react/troubleshooting.md} +3 -1
  235. package/docs/integrations/adobe-analytics.md +160 -0
  236. package/docs/integrations/ahrefs-analytics.md +157 -0
  237. package/docs/integrations/amplitude.md +230 -0
  238. package/docs/integrations/building-integrations.md +15 -181
  239. package/docs/integrations/clearbit.md +130 -0
  240. package/docs/integrations/cloudflare-web-analytics.md +126 -0
  241. package/docs/integrations/crisp.md +140 -0
  242. package/docs/integrations/databuddy.md +152 -150
  243. package/docs/integrations/fathom-analytics.md +150 -0
  244. package/docs/integrations/google-maps.md +263 -0
  245. package/docs/integrations/google-tag-manager.md +102 -101
  246. package/docs/integrations/google-tag.md +104 -92
  247. package/docs/integrations/heap.md +219 -0
  248. package/docs/integrations/hightouch.md +199 -0
  249. package/docs/integrations/hotjar.md +143 -0
  250. package/docs/integrations/intercom.md +144 -0
  251. package/docs/integrations/linkedin-insights.md +142 -90
  252. package/docs/integrations/logrocket.md +175 -0
  253. package/docs/integrations/matomo-analytics.md +171 -0
  254. package/docs/integrations/meta-pixel.md +379 -309
  255. package/docs/integrations/microsoft-clarity.md +173 -0
  256. package/docs/integrations/microsoft-uet.md +135 -91
  257. package/docs/integrations/mixpanel-analytics.md +130 -0
  258. package/docs/integrations/overview.md +119 -75
  259. package/docs/integrations/pirsch.md +142 -0
  260. package/docs/integrations/plausible-analytics.md +154 -0
  261. package/docs/integrations/posthog.md +186 -127
  262. package/docs/integrations/promptwatch.md +121 -0
  263. package/docs/integrations/reddit-pixel.md +241 -0
  264. package/docs/integrations/rudderstack.md +271 -0
  265. package/docs/integrations/rybbit-analytics.md +143 -0
  266. package/docs/integrations/segment.md +146 -0
  267. package/docs/integrations/snapchat-pixel.md +163 -0
  268. package/docs/integrations/tiktok-pixel.md +101 -91
  269. package/docs/integrations/umami-analytics.md +148 -0
  270. package/docs/integrations/vercel-analytics.md +141 -0
  271. package/docs/integrations/x-pixel.md +123 -109
  272. package/docs/integrations/youtube.md +193 -0
  273. package/docs/shared/concepts/client-modes.md +103 -0
  274. package/docs/shared/concepts/consent-categories.md +41 -0
  275. package/docs/shared/concepts/consent-models.md +72 -0
  276. package/docs/shared/concepts/cookie-management.md +88 -0
  277. package/docs/shared/concepts/glossary.md +24 -0
  278. package/docs/shared/concepts/initialization-flow.md +105 -0
  279. package/docs/shared/concepts/policy-packs.md +225 -0
  280. package/docs/shared/react/components/consent-banner.md +242 -0
  281. package/docs/shared/react/components/consent-dialog-link.md +45 -0
  282. package/docs/shared/react/components/consent-dialog-trigger.md +185 -0
  283. package/docs/shared/react/components/consent-dialog.md +119 -0
  284. package/docs/shared/react/components/consent-manager-provider.md +183 -0
  285. package/docs/shared/react/components/consent-widget.md +121 -0
  286. package/docs/shared/react/components/dev-tools.md +81 -0
  287. package/docs/shared/react/components/frame.md +52 -0
  288. package/docs/shared/react/guides/building-headless-components.md +110 -0
  289. package/docs/shared/react/guides/callbacks.md +89 -0
  290. package/docs/shared/react/guides/headless.md +31 -0
  291. package/docs/shared/react/guides/iframe-blocking.md +65 -0
  292. package/docs/shared/react/guides/internationalization.md +123 -0
  293. package/docs/shared/react/guides/network-blocker.md +72 -0
  294. package/docs/shared/react/guides/optimization.md +44 -0
  295. package/docs/shared/react/guides/policy-packs.md +173 -0
  296. package/docs/shared/react/guides/script-loader.md +309 -0
  297. package/docs/shared/react/hooks/use-color-scheme.md +31 -0
  298. package/docs/shared/react/hooks/use-consent-manager/checking-consent.md +95 -0
  299. package/docs/shared/react/hooks/use-consent-manager/location-info.md +96 -0
  300. package/docs/shared/react/hooks/use-consent-manager/overview.md +74 -0
  301. package/docs/shared/react/hooks/use-consent-manager/setting-consent.md +93 -0
  302. package/docs/shared/react/hooks/use-draggable.md +30 -0
  303. package/docs/shared/react/hooks/use-focus-trap.md +20 -0
  304. package/docs/shared/react/hooks/use-reduced-motion.md +33 -0
  305. package/docs/shared/react/hooks/use-ssr-status.md +16 -0
  306. package/docs/shared/react/hooks/use-text-direction.md +38 -0
  307. package/docs/shared/react/hooks/use-translations.md +15 -0
  308. package/docs/shared/react/iab/consent-banner.md +60 -0
  309. package/docs/shared/react/iab/consent-dialog.md +76 -0
  310. package/docs/shared/react/iab/overview.md +80 -0
  311. package/docs/shared/react/iab/use-gvl-data.md +21 -0
  312. package/docs/shared/react/styling/classnames.md +93 -0
  313. package/docs/shared/react/styling/color-scheme.md +35 -0
  314. package/docs/shared/react/styling/css-variables.md +53 -0
  315. package/docs/shared/react/styling/overview.md +261 -0
  316. package/docs/shared/react/styling/slots.md +93 -0
  317. package/docs/shared/react/styling/stylesheet-entrypoint.md +8 -0
  318. package/docs/shared/react/styling/tailwind.md +88 -0
  319. package/docs/shared/react/styling/tokens.md +155 -0
  320. package/docs/shared/troubleshooting.md +82 -0
  321. package/package.json +23 -12
  322. package/readme.json +12 -7
  323. package/docs/ai-agents.md +0 -111
  324. package/docs/components/consent-dialog-trigger.md +0 -103
  325. package/docs/components/consent-manager-provider.md +0 -425
  326. package/docs/hooks/use-consent-manager/overview.md +0 -420
  327. package/docs/hooks/use-translations.md +0 -118
  328. package/docs/script-loader.md +0 -321
  329. package/docs/styling/css-variables.md +0 -92
  330. package/docs/styling/overview.md +0 -460
  331. package/docs/styling/slots.md +0 -128
  332. package/docs/styling/tokens.md +0 -216
@@ -0,0 +1,103 @@
1
+ ---
2
+ title: Client Modes
3
+ description: Reference page for client modes.
4
+ group: reference
5
+ ---
6
+ c15t supports three client modes that determine how consent data is stored and synchronized. Choose the mode that matches your infrastructure:
7
+
8
+ * **Hosted mode** - Recommended for production. Backend-backed consent with geolocation, centralized policy resolution, audit history, and offline fallback.
9
+ * **Offline mode** - Browser-only storage with no network requests. Best for local development, demos, static deployments, or controlled fallback scenarios.
10
+ * **Custom mode** - Bring your own backend with custom endpoint handlers
11
+
12
+ > ⚠️ **Warning:**
13
+ > If you need durable consent records, server-side enforcement, or automatic jurisdiction detection, use hosted mode. Offline mode cannot provide those guarantees because consent lives only in the browser.
14
+
15
+ <span id="c15t-mode" />
16
+
17
+ ## Hosted Mode (Recommended)
18
+
19
+ The default mode. Connects to a c15t backend for full consent lifecycle management. We recommend using [inth.com](https://inth.com) for a fully managed experience, but you can [self-host](/docs/self-host) as well.
20
+
21
+ > ℹ️ **Info:**
22
+ > mode: 'hosted' is the preferred value. The legacy alias mode: 'c15t' is still supported for backward compatibility.
23
+
24
+ **What happens:**
25
+
26
+ 1. On page load, the client calls `/init` to fetch geolocation, jurisdiction, localized translation strings
27
+ 2. When the user grants or changes consent, it is saved locally before being synced to the backend.
28
+ 3. If the backend is unreachable, it falls back to Offline mode and re-syncs with the backend when it's available
29
+
30
+ **Configuration:**
31
+
32
+ * `backendURL` (required) - API endpoint path
33
+
34
+ **Why it is the default for production:**
35
+
36
+ * The backend stays the source of truth for policy, translations, and jurisdiction logic
37
+ * Consent decisions can be stored beyond the current browser session for audit and support workflows
38
+ * Server-side systems can preload consent-aware behavior instead of waiting for client-only storage
39
+ * If the backend is temporarily unavailable, c15t can fall back locally and re-sync later
40
+
41
+ **Best for:** Production apps that need geolocation-based jurisdiction detection, consent record storage, and compliance audit trails.
42
+
43
+ ## Offline Mode
44
+
45
+ No network requests. Consent is stored entirely in the browser using localStorage and cookies.
46
+
47
+ **What happens:**
48
+
49
+ 1. Default jurisdiction is GDPR unless manually set via `overrides`
50
+ 2. Consent preferences persist locally only
51
+ 3. No server-side consent records or analytics
52
+
53
+ > ℹ️ **Info:**
54
+ > Important: Offline mode still stores consent locally (cookie + localStorage). It only skips backend storage and sync.
55
+
56
+ ### Consequences of Browser-Only Storage
57
+
58
+ If consent is not stored at all (for example, storage is blocked or frequently cleared):
59
+
60
+ * Users are treated as new visitors and must re-consent repeatedly
61
+ * Preferences are lost across browser resets, private sessions, and device changes
62
+ * You have no reliable audit evidence to prove prior consent choices
63
+ * Support and compliance teams have no centralized visibility into consent history by default
64
+ * Server-side systems cannot apply prior consent decisions before client initialization
65
+
66
+ **Trade-offs:**
67
+
68
+ * No automatic geolocation or jurisdiction detection
69
+ * No consent audit trail
70
+ * No centralized policy or translation updates without shipping frontend changes
71
+ * No cross-device sync
72
+ * No server-side visibility before client initialization
73
+ * Works without any backend infrastructure
74
+
75
+ **Best for:** Local development, Storybook/static demos, resilience fallback, or simpler sites that explicitly accept browser-only consent storage.
76
+
77
+ ## Custom Mode
78
+
79
+ Bring your own backend. You provide handler functions for each consent endpoint, and c15t calls them instead of making HTTP requests.
80
+
81
+ **What happens:**
82
+
83
+ 1. On page load, the client calls your endpoint handler to fetch geolocation, jurisdiction, localized translation strings
84
+ 2. When the user grants or changes consent, it is saved locally before being synced to the backend.
85
+ 3. If one of your handlers fails, c15t returns a handler error and keeps local consent state, but automatic offline fallback and retry queue behavior is not provided for custom handlers by default
86
+
87
+ This lets you integrate c15t with any existing API - your CRM, your own consent database, or a third-party compliance service.
88
+
89
+ **Best for:** Teams with existing consent infrastructure that want c15t's frontend without its backend.
90
+
91
+ ## Choosing a Mode
92
+
93
+ |Feature|Hosted|Offline|Custom|
94
+ |--|--|--|--|
95
+ |Geolocation|Automatic|Manual via overrides|Your implementation|
96
+ |Policy source of truth|Backend-managed|Bundled into the frontend|Your implementation|
97
+ |Consent sync|API|Local only|Your implementation|
98
+ |Audit trail|Backend records|Not available|Your implementation|
99
+ |Server-side consent awareness|Supported|Not available|Your implementation|
100
+ |SSR data|Supported|Not available|Your implementation|
101
+ |Analytics|Built-in|Not available|Your implementation|
102
+ |Infrastructure|c15t backend|None|Your backend|
103
+ |Setup effort|Minimal|Zero|Moderate|
@@ -0,0 +1,41 @@
1
+ ---
2
+ title: Consent Categories
3
+ description: Reference page for consent categories.
4
+ group: reference
5
+ ---
6
+ c15t organizes tracking technologies into five consent categories that align with GDPR and ePrivacy Directive requirements. Rather than asking users to approve or deny individual cookies or scripts, each category groups related tracking purposes together so users can make meaningful, informed choices about how their data is used.
7
+
8
+ > ℹ️ **Info:**
9
+ > Why categories, not cookie lists? Many consent banners list individual cookie names like \_ga, \_gid, or \_fbp. This is counterproductive:Technical names are meaningless to users — nobody knows what \_gid does by reading its name.Information overload drives "accept all" — a wall of cookie names pushes users toward dismissing the banner as fast as possible, which is the opposite of informed consent.Purpose is what matters — privacy regulations (GDPR, ePrivacy) require clear information about the purposes of data processing, not a cookie-by-cookie inventory.Cookie lists go stale — third-party scripts change their cookie names across versions, creating a maintenance burden that provides no real transparency.c15t's category-based approach — "measurement", "marketing", "experience" — communicates purpose directly. Users understand why data is collected, not how it is stored.
10
+
11
+ ## The Five Categories
12
+
13
+ |Category|Default|Toggleable|Description|
14
+ |--|--|--|--|
15
+ |`necessary`|`true`|No|Strictly necessary to operate or deliver the service|
16
+ |`functionality`|`false`|Yes|Basic interactions and functionalities|
17
+ |`experience`|`false`|Yes|Improve quality of user experience|
18
+ |`measurement`|`false`|Yes|Measure traffic and analyze behavior|
19
+ |`marketing`|`false`|Yes|Deliver personalized ads or marketing content|
20
+
21
+ The `necessary` category has `disabled: true` set internally, which prevents the user from toggling it off in the consent UI. All other categories can be freely toggled by the user.
22
+
23
+ Note that all categories except `necessary` have `display: false` by default. A category appears in the consent UI only if you include it in `consentCategories`. Categories not listed are hidden from the UI, but they still exist in consent state and may be affected by model-level behavior (for example, auto-grant in `opt-out` or `null` model flows).
24
+
25
+ ## Configuring Categories
26
+
27
+ The `consentCategories` array controls which consent categories are presented to the user in the consent UI. Only categories you list in this array will appear as toggleable options in the consent banner or modal.
28
+
29
+ The `necessary` category is always implicitly included even if you do not add it to the array. You never need to worry about accidentally omitting it -- c15t ensures it is always present and always enabled.
30
+
31
+ For example, if you set:
32
+
33
+ ```
34
+ consentCategories: ['necessary', 'measurement', 'marketing']
35
+ ```
36
+
37
+ then only those three categories will show toggles in the consent UI. The `functionality` and `experience` categories will not appear as user-configurable toggles.
38
+
39
+ In `opt-in`/`iab` flows, hidden categories usually remain `false` unless you explicitly set them. In `opt-out`/`null` flows, categories may be auto-granted even when hidden.
40
+
41
+ This gives you precise control over which consent choices to present to your users. A simple blog that only runs an analytics script might only need `measurement`. A media site with ad integrations would include `marketing`. A SaaS application with personalization features might add `experience` and `functionality` as well. You choose what is relevant to your site and c15t handles the rest - storing consent state, exposing it through hooks, and ensuring the right categories are active based on the user's choices.
@@ -0,0 +1,72 @@
1
+ ---
2
+ title: Consent Models
3
+ description: Reference page for consent models.
4
+ group: reference
5
+ ---
6
+ c15t supports four consent models that control how consent defaults, banner visibility, and category gating behave:
7
+
8
+ |Model|Philosophy|Banner|Categories default to|
9
+ |--|--|--|--|
10
+ |`opt-in`|Explicit consent required|Blocking banner|`false` (except `necessary`)|
11
+ |`opt-out`|Processing allowed by default|Non-blocking notice|`true` (all granted)|
12
+ |`iab`|IAB TCF 2.3 for programmatic ads|TCF banner|Managed by TCF framework|
13
+ |`null`|No regulation detected|No banner|`true` (all auto-granted)|
14
+
15
+ There are two ways c15t determines which model applies:
16
+
17
+ 1. **Policy packs** (recommended) — you explicitly set the model per region in a `PolicyConfig`. This gives you full control over which regions get which model. See [Policy Packs](/docs/frameworks/react/concepts/policy-packs).
18
+
19
+ 2. **Automatic jurisdiction mapping** (legacy default) — when no policy pack is configured, c15t detects the visitor's jurisdiction via geolocation and maps it to a model using the table below. This still works but gives you less control over categories, UI, and scope.
20
+
21
+ > ℹ️ **Info:**
22
+ > When using policy packs, the consent.model field in each policy directly sets the model — the automatic jurisdiction mapping is bypassed for that request.
23
+
24
+ ## The Four Models
25
+
26
+ ### Opt-in
27
+
28
+ The strictest consent model, used for GDPR and similar regulations that require explicit, affirmative consent before any non-essential data processing occurs. All consent categories except `necessary` default to `false`. A consent banner must be shown before any tracking scripts load.
29
+
30
+ Applies to: EU (GDPR), UK (UK GDPR), Switzerland, Brazil (LGPD), Japan (APPI), South Korea (PIPA), Quebec (Law 25). Also the fallback for unknown jurisdiction codes.
31
+
32
+ ### Opt-out
33
+
34
+ Used for CCPA-style regulations where data processing is permitted by default until the user exercises their right to opt out. All consent categories default to `true`. A blocking banner is not required — the typical pattern is a non-intrusive notice or footer link.
35
+
36
+ Applies to: California (CCPA), Canada (PIPEDA), Australia.
37
+
38
+ When the policy has `consent.gpc: true`, the browser's Global Privacy Control signal (`Sec-GPC: 1` or `navigator.globalPrivacyControl`) is respected — `marketing` and `measurement` are denied while other categories remain granted. The built-in California presets enable this by default. See [Policy Packs — GPC](/docs/frameworks/react/concepts/policy-packs#gpc) for details.
39
+
40
+ ### IAB
41
+
42
+ IAB Transparency and Consent Framework (TCF) 2.3 mode for programmatic advertising compliance. Only activates when two conditions are met: the jurisdiction is `GDPR` or `UK_GDPR`, and `iab.enabled` is `true` in your configuration.
43
+
44
+ When active, IAB mode generates TC strings, registers the `__tcfapi` CMP API, and works with the Global Vendor List (GVL) for machine-readable consent signals. If `iab.enabled` is not set, GDPR jurisdictions fall back to standard opt-in.
45
+
46
+ ### null
47
+
48
+ Returned when no jurisdiction is detected (`NONE` or `null`). No banner is displayed. On first visit, all categories are auto-granted.
49
+
50
+ ## Jurisdiction Mapping
51
+
52
+ When no policy pack is configured, c15t maps jurisdictions to models automatically:
53
+
54
+ |Jurisdiction Code|Region|Consent Model|
55
+ |--|--|--|
56
+ |`GDPR`|European Union|opt-in|
57
+ |`UK_GDPR`|United Kingdom|opt-in|
58
+ |`CH`|Switzerland|opt-in|
59
+ |`BR`|Brazil (LGPD)|opt-in|
60
+ |`APPI`|Japan|opt-in|
61
+ |`PIPA`|South Korea|opt-in|
62
+ |`PIPEDA`|Canada (excl. Quebec)|opt-out|
63
+ |`QC_LAW25`|Quebec, Canada|opt-in|
64
+ |`CCPA`|California, USA|opt-out|
65
+ |`AU`|Australia|opt-out|
66
+ |`NONE`|No jurisdiction|null|
67
+ |*(unknown)*|Any other|opt-in|
68
+
69
+ **IAB override:** If `iab.enabled: true` and the jurisdiction is `GDPR` or `UK_GDPR`, the model becomes `'iab'` instead of `'opt-in'`. This override only applies to those two jurisdictions.
70
+
71
+ > ℹ️ **Info:**
72
+ > With policy packs, you set the model explicitly per policy — the automatic mapping above is only used as a fallback when no policy pack is configured, or for non-policy-pack features like auto-granting in opt-out jurisdictions.
@@ -0,0 +1,88 @@
1
+ ---
2
+ title: Cookie Management
3
+ description: Reference page for cookie management.
4
+ group: reference
5
+ ---
6
+ Cookie management is the most commonly misunderstood part of consent. A critical distinction: **c15t does not manage all cookies on your site.** It controls what scripts, iframes, and network requests are allowed to load - and those third-party resources are what set most cookies.
7
+
8
+ Understanding this distinction is key to building a compliant consent flow: c15t gates the sources of cookies, not the cookies themselves.
9
+
10
+ ## What Actually Sets Cookies
11
+
12
+ There are four sources of cookies on a typical website:
13
+
14
+ **1. c15t itself**
15
+ c15t stores the user's consent state in a `c15t` cookie (and mirrors it to localStorage). This cookie records which categories the user consented to, when they consented, and their subject ID. This is a strictly necessary cookie - it exists so the site remembers the user's consent choice.
16
+
17
+ **2. Third-party scripts**
18
+ When you load a tracking script (Google Analytics, Meta Pixel, etc.), that script sets its own cookies. Google Analytics creates `_ga` and `_gid` cookies. Meta creates `_fbp` and `_fbc`. These cookies are set by the script's code running in the browser - c15t prevents them by not loading the script until the user consents.
19
+
20
+ **3. Embedded iframes**
21
+ YouTube embeds, social media widgets, and other iframes can set cookies via their embedded content. c15t's iframe blocker replaces iframes with placeholders until consent is granted, preventing these cookies from being set.
22
+
23
+ **4. Network requests**
24
+ Server responses can include `Set-Cookie` headers. If your page makes requests to third-party APIs or CDNs, those responses may set cookies. c15t's network blocker can intercept `fetch` and `XMLHttpRequest` calls to prevent these requests from happening without consent.
25
+
26
+ > ⚠️ **Warning:**
27
+ > Don't list these cookies in your banner. The cookie names above (\_ga, \_gid, \_fbp, \_fbc) are implementation details — they matter for developers understanding how tracking works, but they should not be exposed to end users in your consent UI. Users don't know what \_ga means, and listing it doesn't help them make an informed choice. Instead, use purpose-based consent categories like "measurement" or "marketing" that communicate why data is collected, not how it is stored.
28
+
29
+ ## Why Revoking Consent Requires a Page Reload
30
+
31
+ When a user revokes consent for a category (e.g., turns off "measurement" after previously granting it), c15t reloads the page by default. This is not a limitation - it's the only reliable approach.
32
+
33
+ **Why you can't just delete third-party cookies from JavaScript:**
34
+
35
+ * **`httpOnly` cookies** - Many tracking cookies are set with the `httpOnly` flag, which prevents JavaScript from reading or deleting them. Only the server that set them can remove them.
36
+ * **Domain restrictions** - Cookies set on `.google.com` or `.facebook.com` can only be deleted by those domains. Your JavaScript running on `yourdomain.com` has no access.
37
+ * **Alternative storage** - Some scripts also write to `localStorage`, `sessionStorage`, `IndexedDB`, or even Web Workers. Cleaning up all possible storage locations is impractical.
38
+ * **In-memory state** - A loaded script has already executed. Its event listeners, timers, and in-memory data persist until the page unloads. You can't "unrun" JavaScript.
39
+
40
+ **The reliable solution: don't load the scripts in the first place.** A page reload creates a fresh execution context. On the fresh page, c15t reads the updated consent state and simply never loads the scripts that lost consent. No script means no cookies, no tracking, no in-memory state.
41
+
42
+ **When reload does NOT happen:**
43
+
44
+ * When a user is declining consent for the **first time** (no prior consent existed, so no scripts were loaded to clean up)
45
+ * When `reloadOnConsentRevoked` is set to `false`
46
+ * When the user is only **adding** consent (no revocations)
47
+
48
+ ## The Revocation Flow
49
+
50
+ When a user revokes consent, the following sequence occurs:
51
+
52
+ **Simplified**
53
+
54
+ 1. **User revokes consent** — e.g. turns off "measurement" in the consent dialog
55
+ 2. **New consent saved** — updated preferences are written to cookies and localStorage
56
+ 3. **Pending sync stored** — the API update is deferred to localStorage (`c15t:pending-consent-sync`)
57
+ 4. **Page reloads** — a fresh execution context ensures revoked scripts never load
58
+ 5. **Fresh init** — c15t reads updated consent; scripts without consent are never loaded
59
+ 6. **Deferred API sync** — the pending consent change is sent to the backend and cleared from localStorage
60
+
61
+ **Sequence Diagram**
62
+
63
+ ```mermaid
64
+ sequenceDiagram
65
+ participant User
66
+ participant UI as Consent UI
67
+ participant Store as Consent Store
68
+ participant Storage as Cookie + localStorage
69
+ participant API as c15t Backend
70
+ participant Browser
71
+
72
+ User->>UI: Revokes "measurement" consent
73
+ UI->>Store: saveConsents({ type: 'custom' })
74
+ Store->>Store: shouldReloadOnConsentChange() → true
75
+ Store->>Storage: Save new consent state
76
+ Store->>Storage: Store PendingConsentSync in localStorage
77
+ Store->>Browser: onBeforeConsentRevocationReload callback
78
+ Store->>Browser: window.location.reload()
79
+ Browser->>Browser: Fresh page load
80
+ Browser->>Storage: Read consent state
81
+ Browser->>Store: Initialize with updated consents
82
+ Note over Store: Scripts without consent are never loaded
83
+ Store->>Storage: Read PendingConsentSync
84
+ Store->>API: Sync consent to backend
85
+ Store->>Storage: Clear PendingConsentSync
86
+ ```
87
+
88
+ **Key detail:** The API sync happens *after* the reload, not before. This ensures the page reloads as fast as possible. The pending sync data is stored in localStorage under the key `c15t:pending-consent-sync` and is picked up by the fresh page's initialization.
@@ -0,0 +1,24 @@
1
+ ---
2
+ title: Glossary
3
+ description: Reference page for glossary.
4
+ group: reference
5
+ ---
6
+ ### Core Terms
7
+
8
+ |Term|Definition|
9
+ |--|--|
10
+ |`subjectId`|Client-generated device/browser identifier (`sub_xxx`). Stored in the `c15t` cookie. Created on first consent save.|
11
+ |`externalId`|Your authenticated user's ID (from Clerk, Auth0, etc.), linked via `identifyUser()`. Connects a device to a user account.|
12
+ |`consents`|The **saved** consent state — `Record<string, boolean>` mapping categories to granted/denied. Used for gating scripts, iframes, and network requests.|
13
+ |`selectedConsents`|**Unsaved** toggle state — what the user has toggled in the dialog but hasn't submitted yet. Becomes `consents` after save.|
14
+ |`mode`|Client operating mode: `'hosted'` (full backend), `'offline'` (local only), or `'custom'` (bring your own handlers). Legacy alias: `'c15t'`. Set once in provider config. See [Client Modes](/docs/frameworks/react/concepts/client-modes).|
15
+ |`model`|Consent regulatory model derived from jurisdiction: `'opt-in'`, `'opt-out'`, `'iab'`, or `null`. See [Consent Models](/docs/frameworks/react/concepts/consent-models).|
16
+
17
+ ### Regulatory Terms
18
+
19
+ |Term|Definition|
20
+ |--|--|
21
+ |`jurisdiction`|A privacy regulation code (e.g., `GDPR`, `CCPA`, `PIPEDA`, `QC_LAW25`) detected from the user's geolocation. Maps to a consent model. See [Consent Models](/docs/frameworks/react/concepts/consent-models) for the full mapping table.|
22
+ |GPC|Global Privacy Control — a browser signal (`Sec-GPC: 1`) indicating the user opts out of data sale/sharing. Honored when a policy sets `consent.gpc: true` (enabled by default in California presets).|
23
+ |TCF|IAB Transparency and Consent Framework (v2.3) — a standard for programmatic advertising consent in GDPR jurisdictions. See [IAB TCF](/docs/frameworks/react/iab/overview).|
24
+ |GVL|Global Vendor List — an IAB-maintained registry of ad-tech vendors and their declared purposes, used by the TCF consent flow.|
@@ -0,0 +1,105 @@
1
+ ---
2
+ title: Initialization Flow
3
+ description: Reference page for initialization flow.
4
+ group: reference
5
+ ---
6
+ When the consent provider mounts, it creates a cached consent runtime, reads any stored consent from the browser, fetches the resolved policy from the backend (or uses SSR/offline data), and decides whether to show the banner. This entire sequence completes before the first meaningful consent-aware render.
7
+
8
+ ## Lifecycle Sequence
9
+
10
+ **Simplified**
11
+
12
+ 1. **Provider mounts** — creates (or retrieves from cache) a consent runtime and store
13
+ 2. **Check stored consent** — reads existing consent from cookies / localStorage; if found and the policy fingerprint hasn't changed, the banner stays hidden
14
+ 3. **Fetch init data** — calls the backend `GET /init` (or uses SSR/offline data) for the resolved policy, location, and translations
15
+ 4. **Apply resolved policy** — the backend resolves the policy from your [policy pack](/docs/frameworks/react/concepts/policy-packs) based on visitor geo (region → country → fallback → default). The response includes the consent model, categories, UI mode, and a material fingerprint. If no policy pack is configured, the legacy jurisdiction-to-model mapping is used instead.
16
+ 5. **Decide banner visibility** — shows the banner only if no prior consent exists, the resolved policy requires it (`ui.mode` is `banner` or `dialog`), or the policy fingerprint changed since last consent
17
+ 6. **Gating enforced** — scripts, iframes, and network requests tagged with a consent category are blocked until that category is granted
18
+ 7. **User interacts** — choices are persisted to storage, synced to the backend (with `policySnapshotToken` if configured), and blocked scripts/iframes load immediately after consent is granted
19
+
20
+ **Sequence Diagram**
21
+
22
+ ```mermaid
23
+ sequenceDiagram
24
+ participant Provider as ConsentManagerProvider
25
+ participant Store as Consent Store
26
+ participant Storage as localStorage / Cookie
27
+ participant API as c15t Backend
28
+ participant UI as Banner / Dialog
29
+ participant Scripts as Script Loader
30
+
31
+ Provider->>Store: getOrCreateConsentRuntime()
32
+ Store->>Storage: getStoredConsent()
33
+ alt Stored consent exists
34
+ Storage-->>Store: consentInfo + consents
35
+ Store->>Store: activeUI = 'none'
36
+ else No stored consent
37
+ Store->>Store: isLoadingConsentInfo = true
38
+ end
39
+
40
+ Store->>Store: initConsentManager()
41
+ Store->>Storage: Check pending consent sync
42
+ opt Pending sync from revocation reload
43
+ Store->>API: Deferred setConsent() (non-blocking)
44
+ end
45
+
46
+ alt SSR data provided
47
+ Store->>Store: tryUseSSRData()
48
+ else No SSR data
49
+ Store->>API: GET /init
50
+ API-->>Store: policy, policyDecision, location, translations
51
+ end
52
+
53
+ Store->>Store: Apply resolved policy (model, categories, ui.mode)
54
+ Store->>Store: Check fingerprint change → re-prompt if needed
55
+ Store->>Store: Set activeUI, auto-grant if opt-out/none
56
+
57
+ alt User has no prior consent or policy changed
58
+ UI->>UI: Banner / Dialog appears (per policy ui.mode)
59
+ UI->>Store: saveConsents({ type })
60
+ Store->>Storage: Persist consent + subjectId + fingerprint
61
+ Store->>Scripts: updateScripts(), updateIframes(), updateNetwork()
62
+ Store->>API: POST /subjects + policySnapshotToken (non-blocking)
63
+ end
64
+ ```
65
+
66
+ ## How It Works
67
+
68
+ **Mount** — When the provider renders, it creates (or retrieves from cache) a consent runtime and store. Any existing consent is read from localStorage/cookies immediately. If consent already exists and the policy fingerprint matches, the banner stays hidden and gating rules apply right away. See [Client Modes](/docs/frameworks/react/concepts/client-modes) for how the mode affects runtime creation.
69
+
70
+ **Init** — The store fetches the resolved policy, location, and translation data. In hosted mode this calls `GET /init` on your backend; in offline mode it resolves from `offlinePolicy.policyPacks` locally. If SSR data was passed to the provider, the network fetch is skipped entirely. See [Server-Side Utilities](/docs/frameworks/react/server-side) for SSR setup.
71
+
72
+ **Policy resolution** — When [policy packs](/docs/frameworks/react/concepts/policy-packs) are configured, the backend resolves the right policy for the visitor based on their geo-location (region → country → fallback → default). The resolved policy determines the consent model (`opt-in`, `opt-out`, `iab`, or `none`), which categories are in scope, and what UI to show. For `opt-out` and `none` models, all categories are auto-granted — unless the resolved policy has `consent.gpc: true` and the browser sends a Global Privacy Control signal, in which case `marketing` and `measurement` are denied. If no policy pack is configured, the legacy jurisdiction-to-model mapping is used instead. See [Consent Models](/docs/frameworks/react/concepts/consent-models) for details.
73
+
74
+ **Re-prompting** — If the resolved policy's material fingerprint differs from the fingerprint stored with the user's last consent, the banner is shown again. This happens automatically when you change consent-affecting fields (model, categories, scope mode, allowed actions). Presentation-only changes do not trigger re-prompts. See [Policy Packs — Re-Prompting](/docs/frameworks/react/concepts/policy-packs#re-prompting) for details.
75
+
76
+ **Save** — When the user interacts with the banner or dialog, their choices are persisted to localStorage/cookies and synced to the backend (along with the `policySnapshotToken` if snapshot signing is configured). Script, iframe, and network gating rules update immediately based on the new consent state. See the [Script Loader](/docs/frameworks/react/script-loader), [Iframe Blocking](/docs/frameworks/react/iframe-blocking), and [Network Blocker](/docs/frameworks/react/network-blocker) guides for gating details.
77
+
78
+ **Revocation** — If a user revokes a previously granted category, the page reloads by default to ensure a clean execution environment. The API sync is deferred to the fresh page load. See [Cookie Management](/docs/frameworks/react/concepts/cookie-management) for revocation and persistence details.
79
+
80
+ ## When Does the Banner Show?
81
+
82
+ The banner appears when any of these conditions are true:
83
+
84
+ 1. **No existing consent** — the user has never consented (or their consent was cleared), **and** the resolved policy requires a UI (`ui.mode` is `banner` or `dialog`, or the model is `opt-in` or `iab`)
85
+ 2. **Policy changed** — the material policy fingerprint differs from the fingerprint stored with the user's last consent (re-prompting)
86
+ 3. **Storage is accessible** — the browser allows localStorage (not blocked in private mode)
87
+
88
+ If the resolved model is `none` or `opt-out` (and `ui.mode` is `none`), consents are auto-granted and the banner never appears. See [Consent Models](/docs/frameworks/react/concepts/consent-models) and [Policy Packs](/docs/frameworks/react/concepts/policy-packs) for details.
89
+
90
+ ## Debugging the Lifecycle
91
+
92
+ Use the DevTools panel and callbacks to inspect each step of the initialization flow. `onConsentSet` is the broad lifecycle signal; `onConsentChanged` and `subscribeToConsentChanges()` are the change-only signals for explicit post-init saves.
93
+
94
+ |Step|DevTools Panel|Callback|What to check|
95
+ |--|--|--|--|
96
+ |Init / SSR hydration|Location|`onBannerFetched`|jurisdiction, countryCode, regionCode populated?|
97
+ |Policy resolution|Policy|`onBannerFetched`|`policyId`, `matchedBy`, `fingerprint` in policyDecision|
98
+ |Model resolution|Location|`onBannerFetched`|`model` value matches the resolved policy|
99
+ |Banner visibility|Consents|—|`activeUI` in store state; does policy `ui.mode` require it?|
100
+ |Re-prompting|Policy|—|Fingerprint mismatch between stored and resolved policy?|
101
+ |Consent save|Consents + Events|`onConsentSet`|`preferences` object in callback payload|
102
+ |Change-only integrations|Events|`onConsentChanged` or `subscribeToConsentChanges()`|`allowedCategories`, `deniedCategories`, and previous values only when a real save changed preferences|
103
+ |Script loading|Scripts|`onConsentSet`|Script IDs and their load/blocked status|
104
+ |Reload on revocation|Events|`onBeforeConsentRevocationReload`|Fires before reload; check localStorage for `c15t:pending-consent-sync`|
105
+ |Deferred sync|Events|`onError` (if sync fails)|After reload, check Events panel for successful API call|