UNPKG

c15t

Version:

Headless JavaScript consent management platform for cookie banners, privacy preferences, consent storage, and script gating.

122 lines (97 loc) 3.17 kB
--- title: Promptwatch description: Promptwatch analyzes traffic on your site for Artificial Intelligence (AI) traffic and usage insights. Data is stored in the EU without user-identifiable information. group: integrations icon: promptwatch --- [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. ## Integrate with c15t **React** ```tsx import { type ReactNode } from 'react'; import { ConsentManagerProvider } from '@c15t/react'; import { promptwatch } from '@c15t/scripts/promptwatch'; const scripts = [ promptwatch({ projectId: '7d60345b-27bb-4779-a385-d4fc19ce732c', }), ]; export function ConsentProvider({ children }: { children: ReactNode }) { return ( <ConsentManagerProvider options={{ mode: 'hosted', backendURL: 'https://your-instance.c15t.dev', scripts, }} > {children} </ConsentManagerProvider> ); } ``` **Next.js** ```tsx 'use client'; import { type ReactNode } from 'react'; import { ConsentManagerProvider } from '@c15t/nextjs'; import { promptwatch } from '@c15t/scripts/promptwatch'; const scripts = [ promptwatch({ projectId: '7d60345b-27bb-4779-a385-d4fc19ce732c', }), ]; export function ConsentProvider({ children }: { children: ReactNode }) { return ( <ConsentManagerProvider options={{ mode: 'hosted', backendURL: '/api/c15t', scripts, }} > {children} </ConsentManagerProvider> ); } ``` **JavaScript** ```ts import { getOrCreateConsentRuntime } from 'c15t'; import { promptwatch } from '@c15t/scripts/promptwatch'; getOrCreateConsentRuntime({ mode: 'hosted', backendURL: 'https://your-instance.c15t.dev', scripts: [ promptwatch({ projectId: '7d60345b-27bb-4779-a385-d4fc19ce732c', }), ], }); ``` ## How c15t loads it * **Category:** `measurement` (Analytics) * **Loads when:** measurement consent is granted * **On revocation:** unloaded - c15t removes the script from the DOM and pauses Promptwatch data collection until consent is granted again. To use a custom loader URL: ```ts promptwatch({ projectId: '7d60345b-27bb-4779-a385-d4fc19ce732c', scriptUrl: 'https://cdn.example.com/promptwatch.js', }); ``` ## Types ### PromptwatchOptions |Property|Value| |:--|:--| |Type Name|\`PromptwatchOptions\`| |Source Path|\`./packages/scripts/src/vendors/analytics/promptwatch.ts\`| \*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.\* ### Script |Property|Value| |:--|:--| |Type Name|\`Script\`| |Source Path|\`./packages/core/src/libs/script-loader/types.ts\`| \*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.\*