UNPKG

c15t

Version:

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

131 lines (103 loc) 3.75 kB
--- title: Clearbit description: Visitor and company enrichment loaded with Clearbit's account-keyed tags.js snippet. group: integrations icon: clearbit --- [Clearbit](https://clearbit.com) provides visitor and company enrichment for go-to-market workflows. The official embed loads `https://tag.clearbitscripts.com/v1/{publishableKey}/tags.js` with a `referrerpolicy` of `strict-origin-when-cross-origin`. ## Integrate with c15t **React** ```tsx import { type ReactNode } from 'react'; import { ConsentManagerProvider } from '@c15t/react'; import { clearbit } from '@c15t/scripts/clearbit'; const scripts = [ clearbit({ publishableKey: 'YOUR_PUBLISHABLE_KEY', }), ]; 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 { clearbit } from '@c15t/scripts/clearbit'; const scripts = [ clearbit({ publishableKey: 'YOUR_PUBLISHABLE_KEY', }), ]; export function ConsentProvider({ children }: { children: ReactNode }) { return ( <ConsentManagerProvider options={{ mode: 'hosted', backendURL: '/api/c15t', scripts, }} > {children} </ConsentManagerProvider> ); } ``` **JavaScript** ```ts import { getOrCreateConsentRuntime } from 'c15t'; import { clearbit } from '@c15t/scripts/clearbit'; getOrCreateConsentRuntime({ mode: 'hosted', backendURL: 'https://your-instance.c15t.dev', scripts: [ clearbit({ publishableKey: 'YOUR_PUBLISHABLE_KEY', }), ], }); ``` ## How c15t loads it * **Category:** `marketing` (Analytics discovery, marketing-sensitive consent) * **Loads when:** marketing consent is granted * **On revocation:** unloaded — c15t removes the script element from the DOM. Clearbit enrichment tools are privacy-sensitive because they can identify visitors and companies for profiling, enrichment, and intent use cases. The GitHub issue left the category open between measurement and marketing; c15t defaults this integration to `marketing` because enrichment is not just aggregate measurement. The script stays blocked until marketing consent is granted. On revocation c15t removes the script element it created; tags that Clearbit's loader has already appended can keep running until the next page load (c15t reloads the page on revocation by default), so treat the load gate as the consent boundary. The helper maps Clearbit's official snippet: ```ts clearbit({ publishableKey: 'YOUR_PUBLISHABLE_KEY', }) ``` To proxy or self-host the loader, pass a custom URL: ```ts clearbit({ publishableKey: 'YOUR_PUBLISHABLE_KEY', scriptUrl: 'https://analytics.example.com/clearbit-tags.js', }) ``` ## Types ### ClearbitOptions |Property|Value| |:--|:--| |Type Name|\`ClearbitOptions\`| |Source Path|\`./packages/scripts/src/vendors/analytics/clearbit.ts\`| \*ExtractedTypeTable: Could not extract "ClearbitOptions" from "./packages/scripts/src/vendors/analytics/clearbit.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.\*