@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
@@ -1,39 +1,52 @@
1
1
  ---
2
2
  title: PostHog
3
- description: 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.
4
- lastModified: 2026-04-08
5
-
3
+ description: PostHog is an open-source product analytics platform for tracking
4
+ user behavior, session replays, feature flags, and A/B testing. It supports
5
+ cookieless tracking, allowing analytics to continue even without cookie
6
+ consent.
6
7
  icon: posthog
8
+ group: integrations
7
9
  ---
8
- PostHog is an open-source product analytics platform that helps you understand user behavior, track events, and analyze product usage. Unlike traditional analytics tools, PostHog supports both cookieless and cookie-based tracking. This means you can sync c15t with PostHog and continue collecting analytics even when users haven't given consent—PostHog simply operates in cookieless mode until consent is granted.
10
+ PostHog is an open-source product analytics platform that helps you understand user behavior, track events, and analyze product usage. Unlike traditional analytics tools, PostHog supports both cookieless and cookie-based tracking. This means you can sync c15t with PostHog and, when your PostHog project is configured for cookieless tracking, continue collecting privacy-preserving analytics after a user rejects measurement consent.
11
+
12
+ c15t exposes two integration patterns for PostHog. Pick the one that matches how you already load the SDK:
13
+
14
+ * **PostHog SDK** — your app loads `posthog-js` itself; c15t only synchronizes consent. Recommended for most React apps.
15
+ * **PostHog Script** — c15t loads PostHog's array bootstrap as a managed `Script`.
9
16
 
10
- ## PostHog SDK Implementation
17
+ ## Integrate with c15t
11
18
 
12
- This is the recommended approach if you're using the Posthog JS SDK, this is commonly used in React projects.
19
+ ### SDK pattern
13
20
 
14
- ### Adding the PostHog SDK to c15t
21
+ This is the recommended approach if you're using the PostHog JS SDK; it's commonly used in React projects.
15
22
 
16
- 1. **Initialize Posthog** When you initialize posthog make sure to set cookieless\_mode to on\_reject.
23
+ 1. **Enable cookieless tracking in PostHog** Before using `cookieless_mode`, enable **Cookieless server hash mode** in your PostHog project under **Project Settings** > **Web analytics**. PostHog ignores cookieless events unless this project setting is enabled.
24
+
25
+ 2. **Initialize PostHog** When you initialize PostHog, set `cookieless_mode` to `on_reject`. This keeps PostHog from writing cookies or local/session storage until the user grants measurement consent. If the user rejects measurement consent, c15t calls `opt_out_capturing()` and PostHog switches to cookieless capture.
17
26
 
18
27
  ```ts
19
28
  posthog.init("phc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", {
20
29
  api_host: "https://eu.i.posthog.com",
21
- defaults: "2025-05-24",
30
+ defaults: "2026-01-30",
22
31
  cookieless_mode: 'on_reject'
23
32
  })
24
33
 
25
- posthog.opt_out_capturing() // Avoids accidental tracking without consent till c15t has loaded
34
+ posthog.opt_out_capturing() // Avoids cookie-based capture until c15t syncs consent
26
35
  ```
27
36
 
28
- 2. **Sync settled consent once, then subscribe to real changes** The recommended PostHog SDK approach uses two phases: run one initial sync after c15t has finished resolving consent, then subscribe to future real preference changes with subscribeToConsentChanges().
37
+ 3. **Sync settled consent once, then subscribe to real changes** The recommended PostHog SDK approach uses two phases: run one initial sync after c15t has finished resolving consent, then subscribe to future real preference changes with `subscribeToConsentChanges()`.
29
38
 
30
- > ℹ️ Info:
39
+ With cookieless\_mode: 'on\_reject', denied measurement consent does not mean "no events." It means PostHog records cookieless events without browser persistence. If your product needs denied consent to stop all PostHog event capture, do not use cookieless mode; load or call PostHog only after consent is granted.
40
+
41
+ > ⚠️ Warning:
42
+ > Do not use posthog.has\_opted\_in\_capturing() or posthog.has\_opted\_out\_capturing() to decide whether to show your banner. In recent PostHog versions, has\_opted\_in\_capturing() can return true when consent is still pending. Use c15t's consent store as the source of truth, or use PostHog's get\_explicit\_consent\_status() when you specifically need PostHog's stored consent state.
31
43
  >
32
- > See the integration overview for how to wrap this in your framework (React or Next.js). Pass the callbacks option to your ConsentManagerProvider the same way you would pass scripts.
44
+ > ℹ️ Info:
45
+ > To wrap this in your framework, pass the callbacks option to your ConsentManagerProvider the same way you would pass scripts — see the JavaScript, React, or Next.js script loader guide.
33
46
 
34
47
  ```ts
35
48
  import { getOrCreateConsentRuntime } from 'c15t';
36
- import { posthog } from 'posthog-js';
49
+ import posthog from 'posthog-js';
37
50
 
38
51
  function syncPostHogMeasurementConsent(hasMeasurementConsent: boolean) {
39
52
  if (hasMeasurementConsent) {
@@ -64,136 +77,182 @@ This is the recommended approach if you're using the Posthog JS SDK, this is com
64
77
  ```
65
78
 
66
79
  > ℹ️ Info:
67
- >
68
80
  > Avoid using onConsentSet plus manual deduplication for PostHog. subscribeToConsentChanges() already gives you the exact change-only semantics most analytics SDKs need.
69
81
 
70
- ## PostHog Script Implementation
82
+ ### Script helper pattern
71
83
 
72
- If you want to load posthog via a script tag it's recommended to use this approach.
84
+ If you want to load PostHog via a script tag, it's recommended to use this approach.
73
85
 
74
- By default c15t will always load the script regardless of consent. This is because the script has built-in functionality to opt into and out of tracking based on consent.
86
+ 1. **Choose a region and loading mode** The c15t helper loads PostHog's bootstrap script, calls `posthog.init()` for you, and then synchronizes consent through `posthog.opt_in_capturing()` / `posthog.opt_out_capturing()`. You do not need to call `posthog.init()` separately.
75
87
 
76
- 1. **Initialize Posthog** This script does not load the Posthog script, it only syncs the consent state with Posthog via the Posthog JS SDK.
88
+ Use region to keep PostHog's API, UI, and bootstrap script hosts aligned. c15t defaults to region: 'eu'; set region: 'us' for PostHog Cloud US. You can still pass apiHost, uiHost, or scriptUrl for self-hosted or proxied setups.
77
89
 
78
- This is due to Posthog's use of cookieless tracking. However, you need to set cookieless\_mode to on\_reject when initializing Posthog.
79
-
80
- ```ts
81
- posthog.init("phc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", {
82
- api_host: "https://eu.i.posthog.com",
83
- defaults: "2025-05-24",
84
- // PostHog will not set any cookies until the user has given consent
85
- cookieless_mode: 'on_reject'
86
- })
87
- ```
90
+ The helper supports three loading modes:
88
91
 
89
- 2. **Adding the script to c15t**
92
+ * `loadMode: 'always'` — the backwards-compatible default. PostHog loads immediately and c15t synchronizes measurement consent through PostHog's APIs. Use this when you intentionally want PostHog cookieless behavior after rejection.
93
+ * `loadMode: 'after-consent'` — PostHog is not requested until measurement consent is granted. This is the recommended GDPR/EU cookie-banner default when your policy requires no PostHog network activity before consent.
94
+ * `loadMode: 'disabled'` — returns an inert callback-only script with no PostHog network request. Use this for environment flags or temporary rollouts.
90
95
 
91
96
  > ℹ️ Info:
92
- >
93
- > See the integration overview for how to pass scripts to your framework (JavaScript, React, or Next.js).
97
+ > For a privacy-first GDPR/EU cookie-banner setup, use region: 'eu' with loadMode: 'after-consent'. This keeps PostHog Cloud in the EU region and prevents any PostHog script request until measurement consent is granted.
98
+
99
+ The helper includes these PostHog init defaults:
94
100
 
95
101
  ```ts
96
- import { posthog } from '@c15t/scripts/posthog';
97
-
98
- posthog({
99
- id: 'phc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
100
- apiHost: 'https://eu.i.posthog.com',
101
- scriptUrl: 'https://eu-assets.i.posthog.com/static/array.js',
102
- initOptions: {
103
- api_host: 'https://eu.i.posthog.com',
104
- ui_host: 'https://eu.i.posthog.com',
105
- autocapture: false,
106
- person_profiles: 'identified_only',
107
- }
108
- })
102
+ const initOptions = {
103
+ api_host: 'https://eu.i.posthog.com',
104
+ ui_host: 'https://eu.posthog.com',
105
+ defaults: '2026-01-30',
106
+ cookieless_mode: 'on_reject',
107
+ };
109
108
  ```
110
109
 
110
+ You can still override any of these through initOptions. Keep cookieless\_mode: 'on\_reject' when you want PostHog to use cookieless capture after a consent rejection.
111
+
112
+ 2. **Enable cookieless tracking in PostHog** Enable **Cookieless server hash mode** in your PostHog project under **Project Settings** > **Web analytics** when you use `loadMode: 'always'` and want rejected-consent traffic to be recorded cookielessly. This is required by PostHog before cookieless events are accepted.
113
+
114
+ 3. **Add the script helper**
115
+
116
+ import \{ type ReactNode } from 'react';
117
+ import \{ ConsentManagerProvider } from '@c15t/react';
118
+ import \{ posthog } from '@c15t/scripts/posthog';
119
+
120
+ const scripts = \[
121
+  posthog(\{
122
+  id: 'phc\_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
123
+  region: 'eu',
124
+  loadMode: 'after-consent',
125
+  }),
126
+ ];
127
+
128
+ export function ConsentProvider(\{ children }: \{ children: ReactNode }) \{
129
+  return (
130
+ &#x20;\<ConsentManagerProvider
131
+ &#x20;options=\{\{
132
+ &#x20;mode: 'hosted',
133
+ &#x20;backendURL: 'https\://your-instance.c15t.dev',
134
+ &#x20;scripts,
135
+ &#x20;}}
136
+ &#x20;\>
137
+ &#x20;\{children}
138
+ &#x20;\</ConsentManagerProvider>
139
+ &#x20;);
140
+ }'use client';
141
+
142
+ import \{ type ReactNode } from 'react';
143
+ import \{ ConsentManagerProvider } from '@c15t/nextjs';
144
+ import \{ posthog } from '@c15t/scripts/posthog';
145
+
146
+ const scripts = \[
147
+ &#x20;posthog(\{
148
+ &#x20;id: 'phc\_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
149
+ &#x20;region: 'eu',
150
+ &#x20;loadMode: 'after-consent',
151
+ &#x20;}),
152
+ ];
153
+
154
+ export function ConsentProvider(\{ children }: \{ children: ReactNode }) \{
155
+ &#x20;return (
156
+ &#x20;\<ConsentManagerProvider
157
+ &#x20;options=\{\{
158
+ &#x20;mode: 'hosted',
159
+ &#x20;backendURL: '/api/c15t',
160
+ &#x20;scripts,
161
+ &#x20;}}
162
+ &#x20;\>
163
+ &#x20;\{children}
164
+ &#x20;\</ConsentManagerProvider>
165
+ &#x20;);
166
+ }import \{ getOrCreateConsentRuntime } from 'c15t';
167
+ import \{ posthog } from '@c15t/scripts/posthog';
168
+
169
+ getOrCreateConsentRuntime(\{
170
+ &#x20;mode: 'hosted',
171
+ &#x20;backendURL: 'https\://your-instance.c15t.dev',
172
+ &#x20;scripts: \[
173
+ &#x20;posthog(\{
174
+ &#x20;id: 'phc\_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
175
+ &#x20;region: 'eu',
176
+ &#x20;loadMode: 'after-consent',
177
+ &#x20;}),
178
+ &#x20;],
179
+ });
180
+
181
+ ### No PostHog request before consent
182
+
183
+ If your policy requires PostHog to be completely absent until the user grants measurement consent, use `loadMode: 'after-consent'`:
184
+
185
+ ```ts
186
+ import { posthog } from '@c15t/scripts/posthog';
187
+
188
+ const scripts = [
189
+ posthog({
190
+ id: 'phc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
191
+ region: 'eu',
192
+ loadMode: 'after-consent',
193
+ }),
194
+ ];
195
+ ```
196
+
197
+ With this mode, c15t does not inject the PostHog script until `measurement` consent is granted. PostHog cannot record cookieless rejected-consent events because the SDK has not loaded.
198
+
199
+ For PostHog Cloud US, switch the region:
200
+
201
+ ```ts
202
+ posthog({
203
+ id: 'phc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
204
+ region: 'us',
205
+ });
206
+ ```
207
+
208
+ ## How c15t loads it
209
+
210
+ * **Category:** `measurement` (Analytics)
211
+ * **SDK pattern:** your app loads `posthog-js`; c15t synchronizes
212
+ measurement consent with PostHog opt-in and opt-out APIs.
213
+ * **Script helper pattern:** by default, c15t loads PostHog on page start with
214
+ [`alwaysLoad`](/docs/frameworks/react/script-loader#always-load), then
215
+ switches PostHog between cookie-based and cookieless capture as consent
216
+ changes. Set `loadMode: 'after-consent'` to block the script request until
217
+ measurement consent is granted.
218
+
219
+ ## Tracking events in your app
220
+
221
+ The behavior depends on which pattern you chose:
222
+
223
+ * **SDK Implementation** — your app loaded `posthog-js` itself, so `posthog.capture(...)` is available once your SDK setup has run. c15t calls `opt_in_capturing()` / `opt_out_capturing()` for you. Pending events before c15t syncs consent may be dropped; after denial, PostHog captures cookieless events.
224
+ * **Script Implementation with `loadMode: 'always'`** — `window.posthog` is defined early. c15t calls `opt_in_capturing()` / `opt_out_capturing()` based on consent. Pending events before the PostHog bootstrap finishes may be dropped; after denial, PostHog captures cookieless events when your PostHog project supports cookieless mode.
225
+ * **Script Implementation with `loadMode: 'after-consent'`** — PostHog is unavailable until measurement consent is granted. Guard `posthog.capture(...)` calls or call them only after consent.
226
+
227
+ > ⚠️ **Warning:**
228
+ > PostHog may start a new session when a user moves between cookieless and cookie-based capture. This can split pre-consent and post-consent activity into separate sessions, which may inflate session counts or affect funnels around the consent boundary. Treat this as a PostHog analytics limitation, not a c15t consent sync issue. See the upstream PostHog session continuity issue.
229
+
230
+ ```ts
231
+ posthog.capture('signup');
232
+ ```
233
+
234
+ You do not need to guard these calls with `useConsentManager().has('measurement')` when cookieless measurement after rejection is acceptable. Add your own guard if denied consent should mean no PostHog event capture at all.
235
+
236
+ ## Consent and privacy
237
+
238
+ PostHog's GDPR guidance recommends using PostHog Cloud EU for robust GDPR compliance, configuring consent clearly, and limiting what personal data is collected. Cookieless mode helps avoid browser persistence when measurement consent is rejected, but it does not replace your own legal basis, consent language, data minimization, IP capture settings, or right-to-be-forgotten process.
239
+
111
240
  ## Types
112
241
 
113
242
  ### PosthogConsentOptions
114
243
 
115
- |Property|Type|Description|Default|Required|
116
- |:--|:--|:--|:--|:--:|
117
- |id|string|Your posthog id, begins with 'phc\_'.|-|✅ Required|
118
- |apiHost|string \|undefined|Your posthog api host.|'https\://eu.i.posthog.com'|Optional|
119
- |scriptUrl|string \|undefined|The PostHog array loader URL.|-|Optional|
120
- |initOptions|Record\<string, unknown> \|undefined|PostHog init options passed to \`posthog.init(...)\`.|-|Optional|
244
+ |Property|Value|
245
+ |:--|:--|
246
+ |Type Name|\`PosthogConsentOptions\`|
247
+ |Source Path|\`./packages/scripts/src/vendors/analytics/posthog.ts\`|
248
+
249
+ \*ExtractedTypeTable: Could not extract "PosthogConsentOptions" from "./packages/scripts/src/vendors/analytics/posthog.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
121
250
 
122
251
  ### Script
123
252
 
124
- |Property|Type|Description|Default|Required|
125
- |:--|:--|:--|:--|:--:|
126
- |id|string|Unique identifier for the script|-|✅ Required|
127
- |src|string \|undefined|URL of the script to load|-|Optional|
128
- |textContent|string \|undefined|Inline JavaScript code to execute|-|Optional|
129
- |category|HasCondition\<AllConsentNames>|Consent category or condition required to load this script|-|✅ Required|
130
- |callbackOnly|boolean \|undefined|Whether this is a callback-only script that doesn't need to load an external resource. When true, no script tag will be added to the DOM, only callbacks will be executed.|false|Optional|
131
- |persistAfterConsentRevoked|boolean \|undefined|Whether the script should persist after consent is revoked.|false|Optional|
132
- |alwaysLoad|boolean \|undefined|Whether the script should always load regardless of consent state. This is useful for scripts like Google Tag Manager or PostHog that manage their own consent state internally. The script will load immediately and never be unloaded based on consent changes. Note: When using this option, you are responsible for ensuring the script itself respects user consent preferences through its own consent management.|false|Optional|
133
- |fetchPriority|"high" \|"low" \|"auto" \|undefined|Priority hint for browser resource loading|-|Optional|
134
- |attributes|Record\<string, string> \|undefined|Additional attributes to add to the script element|-|Optional|
135
- |async|boolean \|undefined|Whether to use async loading|-|Optional|
136
- |defer|boolean \|undefined|Whether to defer script loading|-|Optional|
137
- |nonce|string \|undefined|Content Security Policy nonce|-|Optional|
138
- |anonymizeId|boolean \|undefined|Whether to use an anonymized ID for the script element, this helps ensure the script is not blocked by ad blockers|true|Optional|
139
- |target|"head" \|"body" \|undefined|Where to inject the script element in the DOM. Options: \`'head'\`: Scripts are appended to \`\<head>\` (default); \`'body'\`: Scripts are appended to \`\<body>\`|'head'|Optional|
140
- |onBeforeLoad|Object \|undefined|Callback executed before the script is loaded|-|Optional|
141
- |onLoad|Object \|undefined|Callback executed when the script loads successfully|-|Optional|
142
- |onError|Object \|undefined|Callback executed if the script fails to load|-|Optional|
143
- |onConsentChange|Object \|undefined|Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.|-|Optional|
144
- |vendorId|string \|number \|undefined|IAB TCF vendor ID - links script to a registered vendor. When in IAB mode, the script will only load if this vendor has consent. Takes precedence over \`category\` when in IAB mode. Use custom vendor IDs (string or number) to gate non-IAB vendors too.|-|Optional|
145
- |iabPurposes|number\[] \|undefined|IAB TCF purpose IDs this script requires consent for. When in IAB mode and no vendorId is set, the script will only load if ALL specified purposes have consent.|-|Optional|
146
- |iabLegIntPurposes|number\[] \|undefined|IAB TCF legitimate interest purpose IDs. These purposes can operate under legitimate interest instead of consent. The script loads if all iabPurposes have consent OR all iabLegIntPurposes have legitimate interest established.|-|Optional|
147
- |iabSpecialFeatures|number\[] \|undefined|IAB TCF special feature IDs this script requires. Options: 1: Use precise geolocation data; 2: Actively scan device characteristics for identification|-|Optional|
148
-
149
- #### `onBeforeLoad`
150
-
151
- Callback executed before the script is loaded
152
-
153
- |Property|Type|Description|Default|Required|
154
- |:--|:--|:--|:--|:--:|
155
- |id|string|The original script ID|-|✅ Required|
156
- |elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
157
- |hasConsent|boolean|Has consent|-|✅ Required|
158
- |consents|ConsentState|The current consent state|-|✅ Required|
159
- |element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
160
- |error|Error \|undefined|Error information (for error callbacks)|-|Optional|
161
-
162
- #### `onLoad`
163
-
164
- Callback executed when the script loads successfully
165
-
166
- |Property|Type|Description|Default|Required|
167
- |:--|:--|:--|:--|:--:|
168
- |id|string|The original script ID|-|✅ Required|
169
- |elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
170
- |hasConsent|boolean|Has consent|-|✅ Required|
171
- |consents|ConsentState|The current consent state|-|✅ Required|
172
- |element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
173
- |error|Error \|undefined|Error information (for error callbacks)|-|Optional|
174
-
175
- #### `onError`
176
-
177
- Callback executed if the script fails to load
178
-
179
- |Property|Type|Description|Default|Required|
180
- |:--|:--|:--|:--|:--:|
181
- |id|string|The original script ID|-|✅ Required|
182
- |elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
183
- |hasConsent|boolean|Has consent|-|✅ Required|
184
- |consents|ConsentState|The current consent state|-|✅ Required|
185
- |element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
186
- |error|Error \|undefined|Error information (for error callbacks)|-|Optional|
187
-
188
- #### `onConsentChange`
189
-
190
- Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.
191
-
192
- |Property|Type|Description|Default|Required|
193
- |:--|:--|:--|:--|:--:|
194
- |id|string|The original script ID|-|✅ Required|
195
- |elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
196
- |hasConsent|boolean|Has consent|-|✅ Required|
197
- |consents|ConsentState|The current consent state|-|✅ Required|
198
- |element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
199
- |error|Error \|undefined|Error information (for error callbacks)|-|Optional|
253
+ |Property|Value|
254
+ |:--|:--|
255
+ |Type Name|\`Script\`|
256
+ |Source Path|\`./packages/core/src/libs/script-loader/types.ts\`|
257
+
258
+ \*ExtractedTypeTable: Could not extract "Script" from "./packages/core/src/libs/script-loader/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
@@ -0,0 +1,121 @@
1
+ ---
2
+ title: Promptwatch
3
+ description: Promptwatch analyzes traffic on your site for Artificial
4
+ Intelligence (AI) traffic and usage insights. Data is stored in the EU without
5
+ user-identifiable information.
6
+ group: integrations
7
+ icon: promptwatch
8
+ ---
9
+ [Promptwatch](https://promptwatch.com) provides analytics focused on AI-related traffic and usage. The official embed loads a single script with your `data-project-id`. By default, c15t loads this script when `measurement` consent is granted.
10
+
11
+ ## Integrate with c15t
12
+
13
+ **React**
14
+
15
+ ```tsx
16
+ import { type ReactNode } from 'react';
17
+ import { ConsentManagerProvider } from '@c15t/react';
18
+ import { promptwatch } from '@c15t/scripts/promptwatch';
19
+
20
+ const scripts = [
21
+ promptwatch({
22
+ projectId: '7d60345b-27bb-4779-a385-d4fc19ce732c',
23
+ }),
24
+ ];
25
+
26
+ export function ConsentProvider({ children }: { children: ReactNode }) {
27
+ return (
28
+ <ConsentManagerProvider
29
+ options={{
30
+ mode: 'hosted',
31
+ backendURL: 'https://your-instance.c15t.dev',
32
+ scripts,
33
+ }}
34
+ >
35
+ {children}
36
+ </ConsentManagerProvider>
37
+ );
38
+ }
39
+ ```
40
+
41
+ **Next.js**
42
+
43
+ ```tsx
44
+ 'use client';
45
+
46
+ import { type ReactNode } from 'react';
47
+ import { ConsentManagerProvider } from '@c15t/nextjs';
48
+ import { promptwatch } from '@c15t/scripts/promptwatch';
49
+
50
+ const scripts = [
51
+ promptwatch({
52
+ projectId: '7d60345b-27bb-4779-a385-d4fc19ce732c',
53
+ }),
54
+ ];
55
+
56
+ export function ConsentProvider({ children }: { children: ReactNode }) {
57
+ return (
58
+ <ConsentManagerProvider
59
+ options={{
60
+ mode: 'hosted',
61
+ backendURL: '/api/c15t',
62
+ scripts,
63
+ }}
64
+ >
65
+ {children}
66
+ </ConsentManagerProvider>
67
+ );
68
+ }
69
+ ```
70
+
71
+ **JavaScript**
72
+
73
+ ```ts
74
+ import { getOrCreateConsentRuntime } from 'c15t';
75
+ import { promptwatch } from '@c15t/scripts/promptwatch';
76
+
77
+ getOrCreateConsentRuntime({
78
+ mode: 'hosted',
79
+ backendURL: 'https://your-instance.c15t.dev',
80
+ scripts: [
81
+ promptwatch({
82
+ projectId: '7d60345b-27bb-4779-a385-d4fc19ce732c',
83
+ }),
84
+ ],
85
+ });
86
+ ```
87
+
88
+ ## How c15t loads it
89
+
90
+ * **Category:** `measurement` (Analytics)
91
+ * **Loads when:** measurement consent is granted
92
+ * **On revocation:** unloaded - c15t removes the script from the DOM and pauses Promptwatch data collection until consent is granted again.
93
+
94
+ To use a custom loader URL:
95
+
96
+ ```ts
97
+ promptwatch({
98
+ projectId: '7d60345b-27bb-4779-a385-d4fc19ce732c',
99
+ scriptUrl: 'https://cdn.example.com/promptwatch.js',
100
+ });
101
+ ```
102
+
103
+ ## Types
104
+
105
+ ### PromptwatchOptions
106
+
107
+ |Property|Value|
108
+ |:--|:--|
109
+ |Type Name|\`PromptwatchOptions\`|
110
+ |Source Path|\`./packages/scripts/src/vendors/analytics/promptwatch.ts\`|
111
+
112
+ \*ExtractedTypeTable: Could not extract "PromptwatchOptions" from "./packages/scripts/src/vendors/analytics/promptwatch.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
113
+
114
+ ### Script
115
+
116
+ |Property|Value|
117
+ |:--|:--|
118
+ |Type Name|\`Script\`|
119
+ |Source Path|\`./packages/core/src/libs/script-loader/types.ts\`|
120
+
121
+ \*ExtractedTypeTable: Could not extract "Script" from "./packages/core/src/libs/script-loader/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*