@c15t/scripts 2.0.1 → 2.1.0
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.
- package/README.md +9 -9
- package/dist/engine/runtime.cjs +11 -0
- package/dist/engine/runtime.js +11 -0
- package/dist/registry.cjs +338 -0
- package/dist/registry.js +292 -0
- package/dist/types.cjs +18 -0
- package/dist/types.js +10 -1
- package/dist/vendors/_shared/attributes.cjs +51 -0
- package/dist/vendors/_shared/attributes.js +14 -0
- package/dist/vendors/_shared/google-consent.cjs +64 -0
- package/dist/vendors/_shared/google-consent.js +27 -0
- package/dist/vendors/_shared/install-builders.cjs +55 -0
- package/dist/vendors/_shared/install-builders.js +21 -0
- package/dist/vendors/_shared/script-url.cjs +74 -0
- package/dist/vendors/_shared/script-url.js +28 -0
- package/dist/{linkedin-insights.cjs → vendors/ads-and-pixels/linkedin-insights.cjs} +2 -2
- package/dist/{linkedin-insights.js → vendors/ads-and-pixels/linkedin-insights.js} +2 -2
- package/dist/vendors/ads-and-pixels/meta-pixel.cjs +202 -0
- package/dist/vendors/ads-and-pixels/meta-pixel.js +153 -0
- package/dist/{microsoft-uet.cjs → vendors/ads-and-pixels/microsoft-uet.cjs} +31 -14
- package/dist/{microsoft-uet.js → vendors/ads-and-pixels/microsoft-uet.js} +31 -14
- package/dist/vendors/ads-and-pixels/reddit-pixel.cjs +147 -0
- package/dist/vendors/ads-and-pixels/reddit-pixel.js +107 -0
- package/dist/vendors/ads-and-pixels/snapchat-pixel.cjs +127 -0
- package/dist/vendors/ads-and-pixels/snapchat-pixel.js +87 -0
- package/dist/{tiktok-pixel.cjs → vendors/ads-and-pixels/tiktok-pixel.cjs} +2 -2
- package/dist/{tiktok-pixel.js → vendors/ads-and-pixels/tiktok-pixel.js} +2 -2
- package/dist/{x-pixel.cjs → vendors/ads-and-pixels/x-pixel.cjs} +6 -3
- package/dist/{x-pixel.js → vendors/ads-and-pixels/x-pixel.js} +6 -3
- package/dist/vendors/analytics/ahrefs-analytics.cjs +64 -0
- package/dist/vendors/analytics/ahrefs-analytics.js +27 -0
- package/dist/vendors/analytics/cloudflare-web-analytics.cjs +69 -0
- package/dist/vendors/analytics/cloudflare-web-analytics.js +32 -0
- package/dist/{databuddy.cjs → vendors/analytics/databuddy.cjs} +3 -3
- package/dist/{databuddy.js → vendors/analytics/databuddy.js} +3 -3
- package/dist/vendors/analytics/fathom-analytics.cjs +72 -0
- package/dist/vendors/analytics/fathom-analytics.js +35 -0
- package/dist/{google-tag.cjs → vendors/analytics/google-tag.cjs} +7 -28
- package/dist/{google-tag.js → vendors/analytics/google-tag.js} +7 -28
- package/dist/vendors/analytics/hotjar.cjs +81 -0
- package/dist/vendors/analytics/hotjar.js +44 -0
- package/dist/vendors/analytics/matomo-analytics.cjs +228 -0
- package/dist/vendors/analytics/matomo-analytics.js +191 -0
- package/dist/vendors/analytics/microsoft-clarity.cjs +110 -0
- package/dist/vendors/analytics/microsoft-clarity.js +73 -0
- package/dist/vendors/analytics/mixpanel-analytics.cjs +119 -0
- package/dist/vendors/analytics/mixpanel-analytics.js +82 -0
- package/dist/vendors/analytics/plausible-analytics.cjs +118 -0
- package/dist/vendors/analytics/plausible-analytics.js +81 -0
- package/dist/{posthog.cjs → vendors/analytics/posthog.cjs} +69 -6
- package/dist/vendors/analytics/posthog.js +163 -0
- package/dist/vendors/analytics/promptwatch.cjs +66 -0
- package/dist/vendors/analytics/promptwatch.js +29 -0
- package/dist/vendors/analytics/rybbit-analytics.cjs +100 -0
- package/dist/vendors/analytics/rybbit-analytics.js +63 -0
- package/dist/vendors/analytics/segment.cjs +93 -0
- package/dist/vendors/analytics/segment.js +56 -0
- package/dist/vendors/analytics/umami-analytics.cjs +76 -0
- package/dist/vendors/analytics/umami-analytics.js +39 -0
- package/dist/vendors/analytics/vercel-analytics.cjs +90 -0
- package/dist/vendors/analytics/vercel-analytics.js +53 -0
- package/dist/vendors/functional/crisp.cjs +139 -0
- package/dist/vendors/functional/crisp.js +102 -0
- package/dist/vendors/functional/intercom.cjs +85 -0
- package/dist/vendors/functional/intercom.js +45 -0
- package/dist/{google-tag-manager.cjs → vendors/tag-managers/google-tag-manager.cjs} +6 -27
- package/dist/{google-tag-manager.js → vendors/tag-managers/google-tag-manager.js} +6 -27
- package/dist-types/__tests__/helpers.d.ts +141 -0
- package/dist-types/engine/runtime.d.ts +1 -1
- package/dist-types/registry.d.ts +368 -0
- package/dist-types/types.d.ts +13 -0
- package/dist-types/vendors/_shared/attributes.d.ts +35 -0
- package/dist-types/vendors/_shared/google-consent.d.ts +47 -0
- package/dist-types/vendors/_shared/install-builders.d.ts +30 -0
- package/dist-types/vendors/_shared/script-url.d.ts +75 -0
- package/dist-types/{linkedin-insights.d.ts → vendors/ads-and-pixels/linkedin-insights.d.ts} +22 -9
- package/dist-types/vendors/ads-and-pixels/meta-pixel.d.ts +289 -0
- package/dist-types/{microsoft-uet.d.ts → vendors/ads-and-pixels/microsoft-uet.d.ts} +21 -10
- package/dist-types/vendors/ads-and-pixels/reddit-pixel.d.ts +211 -0
- package/dist-types/vendors/ads-and-pixels/snapchat-pixel.d.ts +171 -0
- package/dist-types/{tiktok-pixel.d.ts → vendors/ads-and-pixels/tiktok-pixel.d.ts} +20 -5
- package/dist-types/{x-pixel.d.ts → vendors/ads-and-pixels/x-pixel.d.ts} +21 -4
- package/dist-types/vendors/analytics/ahrefs-analytics.d.ts +62 -0
- package/dist-types/vendors/analytics/cloudflare-web-analytics.d.ts +67 -0
- package/dist-types/vendors/analytics/fathom-analytics.d.ts +90 -0
- package/dist-types/{google-tag.d.ts → vendors/analytics/google-tag.d.ts} +5 -8
- package/dist-types/vendors/analytics/hotjar.d.ts +73 -0
- package/dist-types/vendors/analytics/matomo-analytics.d.ts +41 -0
- package/dist-types/vendors/analytics/microsoft-clarity.d.ts +86 -0
- package/dist-types/vendors/analytics/mixpanel-analytics.d.ts +101 -0
- package/dist-types/vendors/analytics/plausible-analytics.d.ts +122 -0
- package/dist-types/{posthog.d.ts → vendors/analytics/posthog.d.ts} +47 -5
- package/dist-types/vendors/analytics/promptwatch.d.ts +36 -0
- package/dist-types/vendors/analytics/rybbit-analytics.d.ts +82 -0
- package/dist-types/vendors/analytics/segment.d.ts +158 -0
- package/dist-types/vendors/analytics/umami-analytics.d.ts +93 -0
- package/dist-types/vendors/analytics/vercel-analytics.d.ts +66 -0
- package/dist-types/vendors/functional/crisp.d.ts +78 -0
- package/dist-types/vendors/functional/intercom.d.ts +135 -0
- package/dist-types/{google-tag-manager.d.ts → vendors/tag-managers/google-tag-manager.d.ts} +5 -8
- package/package.json +165 -4
- package/dist/meta-pixel.cjs +0 -129
- package/dist/meta-pixel.js +0 -89
- package/dist/posthog.js +0 -100
- package/dist-types/meta-pixel.d.ts +0 -185
- /package/dist-types/{databuddy.d.ts → vendors/analytics/databuddy.d.ts} +0 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { Script } from 'c15t';
|
|
2
|
+
declare global {
|
|
3
|
+
interface Window {
|
|
4
|
+
umami?: {
|
|
5
|
+
identify: (sessionData?: Record<string, unknown> | string) => void;
|
|
6
|
+
track: {
|
|
7
|
+
(payload?: Record<string, unknown>): void;
|
|
8
|
+
(eventName: string, eventData?: Record<string, unknown>): void;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Umami Analytics vendor manifest.
|
|
15
|
+
*
|
|
16
|
+
* Configures Umami entirely through script `data-*` attributes. Umami is a
|
|
17
|
+
* cookieless analytics product, so the script is consent-gated on
|
|
18
|
+
* `measurement` and unloaded when consent is revoked.
|
|
19
|
+
*/
|
|
20
|
+
export declare const umamiAnalyticsManifest: {
|
|
21
|
+
readonly vendor: "umami-analytics";
|
|
22
|
+
readonly category: "measurement";
|
|
23
|
+
readonly install: [{
|
|
24
|
+
readonly type: "loadScript";
|
|
25
|
+
readonly src: "{{scriptUrl}}";
|
|
26
|
+
readonly defer: true;
|
|
27
|
+
readonly attributes: {
|
|
28
|
+
readonly 'data-website-id': "{{websiteId}}";
|
|
29
|
+
readonly 'data-host-url': "{{hostUrl}}";
|
|
30
|
+
readonly 'data-auto-track': "{{autoTrackAttribute}}";
|
|
31
|
+
readonly 'data-domains': "{{domains}}";
|
|
32
|
+
readonly 'data-tag': "{{tag}}";
|
|
33
|
+
readonly 'data-before-send': "{{beforeSend}}";
|
|
34
|
+
};
|
|
35
|
+
}];
|
|
36
|
+
readonly kind: "c15t.vendor-manifest";
|
|
37
|
+
readonly schemaVersion: 1;
|
|
38
|
+
};
|
|
39
|
+
export interface UmamiAnalyticsOptions {
|
|
40
|
+
/**
|
|
41
|
+
* Your Umami website ID.
|
|
42
|
+
*/
|
|
43
|
+
websiteId: string;
|
|
44
|
+
/**
|
|
45
|
+
* Override the host that receives analytics events.
|
|
46
|
+
*/
|
|
47
|
+
hostUrl?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Disable automatic tracking when set to `false`.
|
|
50
|
+
*/
|
|
51
|
+
autoTrack?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Restrict tracking to specific domains.
|
|
54
|
+
*/
|
|
55
|
+
domains?: string[] | string;
|
|
56
|
+
/**
|
|
57
|
+
* Attach a tag to tracked events.
|
|
58
|
+
*/
|
|
59
|
+
tag?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Optional global hook name used for Umami's `data-before-send` attribute.
|
|
62
|
+
*
|
|
63
|
+
* Callback functions are intentionally not supported here because the c15t
|
|
64
|
+
* manifest runtime cannot serialize custom JavaScript functions.
|
|
65
|
+
*/
|
|
66
|
+
beforeSend?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Custom loader URL.
|
|
69
|
+
* @default 'https://cloud.umami.is/script.js'
|
|
70
|
+
*/
|
|
71
|
+
scriptUrl?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Creates an Umami Analytics script.
|
|
75
|
+
*
|
|
76
|
+
* @see https://umami.is/docs/tracker-config
|
|
77
|
+
*
|
|
78
|
+
* @param options - The options for the Umami Analytics script.
|
|
79
|
+
* @returns The Umami Analytics script.
|
|
80
|
+
* @throws {Error} When `websiteId` is missing, empty, or invalid. Provide a
|
|
81
|
+
* valid non-empty `websiteId` string to prevent this error.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* import { umamiAnalytics } from '@c15t/scripts/umami-analytics';
|
|
86
|
+
*
|
|
87
|
+
* umamiAnalytics({
|
|
88
|
+
* websiteId: 'site-abc-123',
|
|
89
|
+
* domains: ['example.com', 'www.example.com'],
|
|
90
|
+
* });
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export declare function umamiAnalytics(options: UmamiAnalyticsOptions): Script;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { Script } from 'c15t';
|
|
2
|
+
export type VercelAnalyticsMode = 'auto' | 'development' | 'production';
|
|
3
|
+
declare global {
|
|
4
|
+
interface Window {
|
|
5
|
+
va?: (event: string, properties?: unknown) => void;
|
|
6
|
+
vaq?: [string, unknown?][];
|
|
7
|
+
vam?: 'development' | 'production';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Vercel Analytics vendor manifest.
|
|
12
|
+
*
|
|
13
|
+
* Seeds Vercel's event queue before loading the tracker bundle.
|
|
14
|
+
*/
|
|
15
|
+
export declare const vercelAnalyticsManifest: {
|
|
16
|
+
readonly vendor: "vercel-analytics";
|
|
17
|
+
readonly category: "measurement";
|
|
18
|
+
readonly bootstrap: [{
|
|
19
|
+
readonly type: "setGlobal";
|
|
20
|
+
readonly name: "vaq";
|
|
21
|
+
readonly value: readonly [];
|
|
22
|
+
readonly ifUndefined: true;
|
|
23
|
+
}, {
|
|
24
|
+
readonly type: "defineStubFunction";
|
|
25
|
+
readonly name: "va";
|
|
26
|
+
readonly queue: {
|
|
27
|
+
readonly global: "vaq";
|
|
28
|
+
};
|
|
29
|
+
readonly queueFormat: "array";
|
|
30
|
+
readonly ifUndefined: true;
|
|
31
|
+
}];
|
|
32
|
+
readonly install: [{
|
|
33
|
+
readonly type: "loadScript";
|
|
34
|
+
readonly src: "{{scriptUrl}}";
|
|
35
|
+
readonly defer: true;
|
|
36
|
+
readonly attributes: {
|
|
37
|
+
readonly 'data-sdkn': "c15t";
|
|
38
|
+
readonly 'data-dsn': "{{dsn}}";
|
|
39
|
+
readonly 'data-disable-auto-track': "{{disableAutoTrackAttribute}}";
|
|
40
|
+
readonly 'data-endpoint': "{{endpoint}}";
|
|
41
|
+
};
|
|
42
|
+
}];
|
|
43
|
+
readonly kind: "c15t.vendor-manifest";
|
|
44
|
+
readonly schemaVersion: 1;
|
|
45
|
+
};
|
|
46
|
+
export interface VercelAnalyticsOptions {
|
|
47
|
+
/** Project DSN for self-hosted or non-Vercel deployments. */
|
|
48
|
+
dsn?: string;
|
|
49
|
+
/** Disable automatic pageview tracking. */
|
|
50
|
+
disableAutoTrack?: boolean;
|
|
51
|
+
/** Preferred script mode. */
|
|
52
|
+
mode?: VercelAnalyticsMode;
|
|
53
|
+
/** Load Vercel's debug bundle when set to `true`. */
|
|
54
|
+
debug?: boolean;
|
|
55
|
+
/** Custom ingestion endpoint. */
|
|
56
|
+
endpoint?: string;
|
|
57
|
+
/** Custom loader URL. */
|
|
58
|
+
scriptUrl?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Creates a Vercel Analytics script.
|
|
62
|
+
*
|
|
63
|
+
* @param options - The options for the Vercel Analytics script.
|
|
64
|
+
* @returns The Vercel Analytics script.
|
|
65
|
+
*/
|
|
66
|
+
export declare function vercelAnalytics(options?: VercelAnalyticsOptions): Script;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { Script } from 'c15t';
|
|
2
|
+
declare global {
|
|
3
|
+
interface Window {
|
|
4
|
+
$crisp: unknown[][];
|
|
5
|
+
CRISP_WEBSITE_ID: string;
|
|
6
|
+
CRISP_RUNTIME_CONFIG?: {
|
|
7
|
+
locale?: string;
|
|
8
|
+
session_merge?: boolean;
|
|
9
|
+
};
|
|
10
|
+
CRISP_COOKIE_DOMAIN?: string;
|
|
11
|
+
CRISP_COOKIE_EXPIRE?: number;
|
|
12
|
+
CRISP_TOKEN_ID?: string;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Crisp vendor manifest.
|
|
17
|
+
*
|
|
18
|
+
* Seeds the Crisp queue and website ID before loading the chat client.
|
|
19
|
+
* Optional runtime globals are added when provided by the helper options.
|
|
20
|
+
*/
|
|
21
|
+
export declare const crispManifest: {
|
|
22
|
+
readonly vendor: "crisp";
|
|
23
|
+
readonly category: "functionality";
|
|
24
|
+
readonly install: [{
|
|
25
|
+
readonly type: "setGlobal";
|
|
26
|
+
readonly name: "$crisp";
|
|
27
|
+
readonly value: readonly [];
|
|
28
|
+
readonly ifUndefined: false;
|
|
29
|
+
}, {
|
|
30
|
+
readonly type: "setGlobal";
|
|
31
|
+
readonly name: "CRISP_WEBSITE_ID";
|
|
32
|
+
readonly value: "{{websiteId}}";
|
|
33
|
+
readonly ifUndefined: false;
|
|
34
|
+
}, {
|
|
35
|
+
readonly type: "loadScript";
|
|
36
|
+
readonly src: "{{scriptSrc}}";
|
|
37
|
+
readonly async: true;
|
|
38
|
+
}];
|
|
39
|
+
readonly kind: "c15t.vendor-manifest";
|
|
40
|
+
readonly schemaVersion: 1;
|
|
41
|
+
};
|
|
42
|
+
export interface CrispOptions {
|
|
43
|
+
/** Your Crisp website ID. */
|
|
44
|
+
websiteId: string;
|
|
45
|
+
/** Optional locale passed through `window.CRISP_RUNTIME_CONFIG`. */
|
|
46
|
+
locale?: string;
|
|
47
|
+
/** Optional cookie domain override for Crisp. */
|
|
48
|
+
cookieDomain?: string;
|
|
49
|
+
/** Optional cookie expiration in seconds. */
|
|
50
|
+
cookieExpiry?: number;
|
|
51
|
+
/** Optional Crisp token ID for session continuity. */
|
|
52
|
+
tokenId?: string;
|
|
53
|
+
/** Whether to merge anonymous sessions into token-backed sessions. */
|
|
54
|
+
sessionMerge?: boolean;
|
|
55
|
+
/** Whether to enable `$crisp` safe mode before other queued calls. */
|
|
56
|
+
safeMode?: boolean;
|
|
57
|
+
/** Crisp loader URL. */
|
|
58
|
+
scriptSrc?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Creates a Crisp chat script.
|
|
62
|
+
*
|
|
63
|
+
* This manifest-based helper keeps the serializable queue/bootstrap globals and
|
|
64
|
+
* omits the upstream ready callback wrapper.
|
|
65
|
+
*
|
|
66
|
+
* @param options - The options for the Crisp script.
|
|
67
|
+
* @returns The Crisp script configuration.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* const crispScript = crisp({
|
|
72
|
+
* websiteId: '1234-abcd',
|
|
73
|
+
* });
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @see {@link https://help.crisp.chat/en/article/how-do-i-install-crisp-live-chat-on-my-website-10wcj3l/} Crisp installation documentation.
|
|
77
|
+
*/
|
|
78
|
+
export declare function crisp(options: CrispOptions): Script;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import type { Script } from 'c15t';
|
|
2
|
+
export declare const INTERCOM_API_BASES: {
|
|
3
|
+
readonly us: "https://api-iam.intercom.io";
|
|
4
|
+
readonly eu: "https://api-iam.eu.intercom.io";
|
|
5
|
+
readonly au: "https://api-iam.au.intercom.io";
|
|
6
|
+
};
|
|
7
|
+
export type IntercomApiBase = (typeof INTERCOM_API_BASES)[keyof typeof INTERCOM_API_BASES] | (string & {});
|
|
8
|
+
export type IntercomThemeMode = 'light' | 'dark' | 'system';
|
|
9
|
+
export interface IntercomAvatar {
|
|
10
|
+
type: 'avatar';
|
|
11
|
+
image_url: string;
|
|
12
|
+
}
|
|
13
|
+
export interface IntercomCompany {
|
|
14
|
+
id?: string;
|
|
15
|
+
company_id?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
created_at?: number;
|
|
18
|
+
remote_created_at?: number;
|
|
19
|
+
plan?: string;
|
|
20
|
+
monthly_spend?: number;
|
|
21
|
+
size?: number;
|
|
22
|
+
website?: string;
|
|
23
|
+
industry?: string;
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
}
|
|
26
|
+
export interface IntercomSettings extends Record<string, unknown> {
|
|
27
|
+
app_id: string;
|
|
28
|
+
api_base: IntercomApiBase;
|
|
29
|
+
custom_launcher_selector?: string;
|
|
30
|
+
alignment?: 'left' | 'right';
|
|
31
|
+
vertical_padding?: number;
|
|
32
|
+
horizontal_padding?: number;
|
|
33
|
+
z_index?: number;
|
|
34
|
+
hide_default_launcher?: boolean;
|
|
35
|
+
hide_notifications?: boolean;
|
|
36
|
+
theme_mode?: IntercomThemeMode;
|
|
37
|
+
session_duration?: number;
|
|
38
|
+
action_color?: string;
|
|
39
|
+
background_color?: string;
|
|
40
|
+
link_color?: string;
|
|
41
|
+
email?: string;
|
|
42
|
+
user_id?: string;
|
|
43
|
+
created_at?: number;
|
|
44
|
+
name?: string;
|
|
45
|
+
phone?: string;
|
|
46
|
+
unsubscribed_from_emails?: boolean;
|
|
47
|
+
language_override?: string;
|
|
48
|
+
utm_campaign?: string;
|
|
49
|
+
utm_content?: string;
|
|
50
|
+
utm_medium?: string;
|
|
51
|
+
utm_source?: string;
|
|
52
|
+
utm_term?: string;
|
|
53
|
+
avatar?: IntercomAvatar;
|
|
54
|
+
user_hash?: string;
|
|
55
|
+
company?: IntercomCompany;
|
|
56
|
+
companies?: IntercomCompany[];
|
|
57
|
+
page_title?: string;
|
|
58
|
+
}
|
|
59
|
+
export type IntercomCustomSettings = Partial<Omit<IntercomSettings, 'app_id' | 'api_base'>> & Record<string, unknown>;
|
|
60
|
+
declare global {
|
|
61
|
+
interface Window {
|
|
62
|
+
Intercom?: ((...args: unknown[]) => void) & {
|
|
63
|
+
q?: unknown[][];
|
|
64
|
+
};
|
|
65
|
+
intercomSettings?: IntercomSettings;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Intercom vendor manifest.
|
|
70
|
+
*
|
|
71
|
+
* Seeds `window.intercomSettings` and a queueing `Intercom` stub before loading
|
|
72
|
+
* the messenger widget bundle.
|
|
73
|
+
*/
|
|
74
|
+
export declare const intercomManifest: {
|
|
75
|
+
readonly vendor: "intercom";
|
|
76
|
+
readonly category: "functionality";
|
|
77
|
+
readonly install: [{
|
|
78
|
+
readonly type: "defineStubFunction";
|
|
79
|
+
readonly name: "Intercom";
|
|
80
|
+
readonly queue: {
|
|
81
|
+
readonly property: "q";
|
|
82
|
+
};
|
|
83
|
+
readonly queueFormat: "array";
|
|
84
|
+
readonly ifUndefined: true;
|
|
85
|
+
}, {
|
|
86
|
+
readonly type: "setGlobal";
|
|
87
|
+
readonly name: "intercomSettings";
|
|
88
|
+
readonly value: "{{settings}}";
|
|
89
|
+
readonly ifUndefined: false;
|
|
90
|
+
}, {
|
|
91
|
+
readonly type: "loadScript";
|
|
92
|
+
readonly src: "{{scriptSrc}}";
|
|
93
|
+
readonly async: true;
|
|
94
|
+
}];
|
|
95
|
+
readonly kind: "c15t.vendor-manifest";
|
|
96
|
+
readonly schemaVersion: 1;
|
|
97
|
+
};
|
|
98
|
+
export interface IntercomOptions {
|
|
99
|
+
/**
|
|
100
|
+
* Your Intercom app ID.
|
|
101
|
+
*/
|
|
102
|
+
appId: string;
|
|
103
|
+
/**
|
|
104
|
+
* Regional Intercom API base.
|
|
105
|
+
*
|
|
106
|
+
* @default 'https://api-iam.intercom.io'
|
|
107
|
+
*/
|
|
108
|
+
apiBase?: IntercomApiBase;
|
|
109
|
+
/**
|
|
110
|
+
* Additional serializable Intercom settings merged into
|
|
111
|
+
* `window.intercomSettings`.
|
|
112
|
+
*/
|
|
113
|
+
settings?: IntercomCustomSettings;
|
|
114
|
+
/** Intercom loader URL. */
|
|
115
|
+
scriptSrc?: string;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Creates an Intercom messenger script.
|
|
119
|
+
*
|
|
120
|
+
* The helper bootstraps the documented Intercom settings object and queues
|
|
121
|
+
* early `Intercom(...)` calls until the messenger bundle loads.
|
|
122
|
+
*
|
|
123
|
+
* @param options - The options for the Intercom script.
|
|
124
|
+
* @returns The Intercom script configuration.
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```ts
|
|
128
|
+
* const intercomScript = intercom({
|
|
129
|
+
* appId: 'abc123',
|
|
130
|
+
* });
|
|
131
|
+
* ```
|
|
132
|
+
*
|
|
133
|
+
* @see {@link https://developers.intercom.com/installing-intercom/web/installation} Intercom installation documentation.
|
|
134
|
+
*/
|
|
135
|
+
export declare function intercom({ appId, apiBase, settings, scriptSrc, }: IntercomOptions): Script;
|
|
@@ -32,7 +32,10 @@ export declare const googleTagManagerManifest: {
|
|
|
32
32
|
readonly type: "pushToQueue";
|
|
33
33
|
readonly queue: "dataLayer";
|
|
34
34
|
readonly value: {
|
|
35
|
-
readonly 'gtm.start':
|
|
35
|
+
readonly 'gtm.start': {
|
|
36
|
+
readonly kind: "c15t.runtime-value";
|
|
37
|
+
readonly value: "timestamp";
|
|
38
|
+
};
|
|
36
39
|
readonly event: "gtm.js";
|
|
37
40
|
};
|
|
38
41
|
}, {
|
|
@@ -45,13 +48,7 @@ export declare const googleTagManagerManifest: {
|
|
|
45
48
|
readonly global: "gtag";
|
|
46
49
|
readonly args: ["event", "{{updateEventName}}"];
|
|
47
50
|
}];
|
|
48
|
-
readonly consentMapping:
|
|
49
|
-
readonly necessary: ["security_storage"];
|
|
50
|
-
readonly functionality: ["functionality_storage"];
|
|
51
|
-
readonly measurement: ["analytics_storage"];
|
|
52
|
-
readonly marketing: ["ad_storage", "ad_user_data", "ad_personalization"];
|
|
53
|
-
readonly experience: ["personalization_storage"];
|
|
54
|
-
};
|
|
51
|
+
readonly consentMapping: Record<string, string[]>;
|
|
55
52
|
readonly consentSignal: "gtag";
|
|
56
53
|
readonly kind: "c15t.vendor-manifest";
|
|
57
54
|
readonly schemaVersion: 1;
|
package/package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c15t/scripts",
|
|
3
|
-
"version": "2.0
|
|
4
|
-
"description": "Pre-built scripts
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"description": "Pre-built scripts for c15t's script loader (GTM, GA4, Meta).",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"c15t",
|
|
7
|
+
"script-loader",
|
|
8
|
+
"consent",
|
|
9
|
+
"gdpr",
|
|
10
|
+
"ccpa",
|
|
11
|
+
"lgpd",
|
|
12
|
+
"gtm",
|
|
13
|
+
"google-tag-manager",
|
|
14
|
+
"google-tag",
|
|
15
|
+
"ga4",
|
|
16
|
+
"google-ads",
|
|
17
|
+
"meta-pixel",
|
|
18
|
+
"posthog",
|
|
19
|
+
"tiktok-pixel",
|
|
20
|
+
"linkedin-insights",
|
|
21
|
+
"microsoft-uet",
|
|
22
|
+
"x-pixel",
|
|
23
|
+
"analytics-consent",
|
|
24
|
+
"consent-mode",
|
|
25
|
+
"privacy",
|
|
26
|
+
"cmp"
|
|
27
|
+
],
|
|
5
28
|
"homepage": "https://c15t.com/docs/frameworks/javascript/script-loader",
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/c15t/c15t/issues"
|
|
31
|
+
},
|
|
6
32
|
"repository": {
|
|
7
33
|
"type": "git",
|
|
8
34
|
"url": "https://github.com/c15t/c15t.git",
|
|
@@ -12,6 +38,141 @@
|
|
|
12
38
|
"sideEffects": false,
|
|
13
39
|
"type": "module",
|
|
14
40
|
"exports": {
|
|
41
|
+
"./ahrefs-analytics": {
|
|
42
|
+
"types": "./dist-types/vendors/analytics/ahrefs-analytics.d.ts",
|
|
43
|
+
"import": "./dist/vendors/analytics/ahrefs-analytics.js",
|
|
44
|
+
"require": "./dist/vendors/analytics/ahrefs-analytics.cjs"
|
|
45
|
+
},
|
|
46
|
+
"./cloudflare-web-analytics": {
|
|
47
|
+
"types": "./dist-types/vendors/analytics/cloudflare-web-analytics.d.ts",
|
|
48
|
+
"import": "./dist/vendors/analytics/cloudflare-web-analytics.js",
|
|
49
|
+
"require": "./dist/vendors/analytics/cloudflare-web-analytics.cjs"
|
|
50
|
+
},
|
|
51
|
+
"./microsoft-clarity": {
|
|
52
|
+
"types": "./dist-types/vendors/analytics/microsoft-clarity.d.ts",
|
|
53
|
+
"import": "./dist/vendors/analytics/microsoft-clarity.js",
|
|
54
|
+
"require": "./dist/vendors/analytics/microsoft-clarity.cjs"
|
|
55
|
+
},
|
|
56
|
+
"./databuddy": {
|
|
57
|
+
"types": "./dist-types/vendors/analytics/databuddy.d.ts",
|
|
58
|
+
"import": "./dist/vendors/analytics/databuddy.js",
|
|
59
|
+
"require": "./dist/vendors/analytics/databuddy.cjs"
|
|
60
|
+
},
|
|
61
|
+
"./fathom-analytics": {
|
|
62
|
+
"types": "./dist-types/vendors/analytics/fathom-analytics.d.ts",
|
|
63
|
+
"import": "./dist/vendors/analytics/fathom-analytics.js",
|
|
64
|
+
"require": "./dist/vendors/analytics/fathom-analytics.cjs"
|
|
65
|
+
},
|
|
66
|
+
"./hotjar": {
|
|
67
|
+
"types": "./dist-types/vendors/analytics/hotjar.d.ts",
|
|
68
|
+
"import": "./dist/vendors/analytics/hotjar.js",
|
|
69
|
+
"require": "./dist/vendors/analytics/hotjar.cjs"
|
|
70
|
+
},
|
|
71
|
+
"./google-tag": {
|
|
72
|
+
"types": "./dist-types/vendors/analytics/google-tag.d.ts",
|
|
73
|
+
"import": "./dist/vendors/analytics/google-tag.js",
|
|
74
|
+
"require": "./dist/vendors/analytics/google-tag.cjs"
|
|
75
|
+
},
|
|
76
|
+
"./matomo-analytics": {
|
|
77
|
+
"types": "./dist-types/vendors/analytics/matomo-analytics.d.ts",
|
|
78
|
+
"import": "./dist/vendors/analytics/matomo-analytics.js",
|
|
79
|
+
"require": "./dist/vendors/analytics/matomo-analytics.cjs"
|
|
80
|
+
},
|
|
81
|
+
"./mixpanel-analytics": {
|
|
82
|
+
"types": "./dist-types/vendors/analytics/mixpanel-analytics.d.ts",
|
|
83
|
+
"import": "./dist/vendors/analytics/mixpanel-analytics.js",
|
|
84
|
+
"require": "./dist/vendors/analytics/mixpanel-analytics.cjs"
|
|
85
|
+
},
|
|
86
|
+
"./plausible-analytics": {
|
|
87
|
+
"types": "./dist-types/vendors/analytics/plausible-analytics.d.ts",
|
|
88
|
+
"import": "./dist/vendors/analytics/plausible-analytics.js",
|
|
89
|
+
"require": "./dist/vendors/analytics/plausible-analytics.cjs"
|
|
90
|
+
},
|
|
91
|
+
"./posthog": {
|
|
92
|
+
"types": "./dist-types/vendors/analytics/posthog.d.ts",
|
|
93
|
+
"import": "./dist/vendors/analytics/posthog.js",
|
|
94
|
+
"require": "./dist/vendors/analytics/posthog.cjs"
|
|
95
|
+
},
|
|
96
|
+
"./promptwatch": {
|
|
97
|
+
"types": "./dist-types/vendors/analytics/promptwatch.d.ts",
|
|
98
|
+
"import": "./dist/vendors/analytics/promptwatch.js",
|
|
99
|
+
"require": "./dist/vendors/analytics/promptwatch.cjs"
|
|
100
|
+
},
|
|
101
|
+
"./segment": {
|
|
102
|
+
"types": "./dist-types/vendors/analytics/segment.d.ts",
|
|
103
|
+
"import": "./dist/vendors/analytics/segment.js",
|
|
104
|
+
"require": "./dist/vendors/analytics/segment.cjs"
|
|
105
|
+
},
|
|
106
|
+
"./rybbit-analytics": {
|
|
107
|
+
"types": "./dist-types/vendors/analytics/rybbit-analytics.d.ts",
|
|
108
|
+
"import": "./dist/vendors/analytics/rybbit-analytics.js",
|
|
109
|
+
"require": "./dist/vendors/analytics/rybbit-analytics.cjs"
|
|
110
|
+
},
|
|
111
|
+
"./umami-analytics": {
|
|
112
|
+
"types": "./dist-types/vendors/analytics/umami-analytics.d.ts",
|
|
113
|
+
"import": "./dist/vendors/analytics/umami-analytics.js",
|
|
114
|
+
"require": "./dist/vendors/analytics/umami-analytics.cjs"
|
|
115
|
+
},
|
|
116
|
+
"./vercel-analytics": {
|
|
117
|
+
"types": "./dist-types/vendors/analytics/vercel-analytics.d.ts",
|
|
118
|
+
"import": "./dist/vendors/analytics/vercel-analytics.js",
|
|
119
|
+
"require": "./dist/vendors/analytics/vercel-analytics.cjs"
|
|
120
|
+
},
|
|
121
|
+
"./crisp": {
|
|
122
|
+
"types": "./dist-types/vendors/functional/crisp.d.ts",
|
|
123
|
+
"import": "./dist/vendors/functional/crisp.js",
|
|
124
|
+
"require": "./dist/vendors/functional/crisp.cjs"
|
|
125
|
+
},
|
|
126
|
+
"./intercom": {
|
|
127
|
+
"types": "./dist-types/vendors/functional/intercom.d.ts",
|
|
128
|
+
"import": "./dist/vendors/functional/intercom.js",
|
|
129
|
+
"require": "./dist/vendors/functional/intercom.cjs"
|
|
130
|
+
},
|
|
131
|
+
"./google-tag-manager": {
|
|
132
|
+
"types": "./dist-types/vendors/tag-managers/google-tag-manager.d.ts",
|
|
133
|
+
"import": "./dist/vendors/tag-managers/google-tag-manager.js",
|
|
134
|
+
"require": "./dist/vendors/tag-managers/google-tag-manager.cjs"
|
|
135
|
+
},
|
|
136
|
+
"./linkedin-insights": {
|
|
137
|
+
"types": "./dist-types/vendors/ads-and-pixels/linkedin-insights.d.ts",
|
|
138
|
+
"import": "./dist/vendors/ads-and-pixels/linkedin-insights.js",
|
|
139
|
+
"require": "./dist/vendors/ads-and-pixels/linkedin-insights.cjs"
|
|
140
|
+
},
|
|
141
|
+
"./meta-pixel": {
|
|
142
|
+
"types": "./dist-types/vendors/ads-and-pixels/meta-pixel.d.ts",
|
|
143
|
+
"import": "./dist/vendors/ads-and-pixels/meta-pixel.js",
|
|
144
|
+
"require": "./dist/vendors/ads-and-pixels/meta-pixel.cjs"
|
|
145
|
+
},
|
|
146
|
+
"./reddit-pixel": {
|
|
147
|
+
"types": "./dist-types/vendors/ads-and-pixels/reddit-pixel.d.ts",
|
|
148
|
+
"import": "./dist/vendors/ads-and-pixels/reddit-pixel.js",
|
|
149
|
+
"require": "./dist/vendors/ads-and-pixels/reddit-pixel.cjs"
|
|
150
|
+
},
|
|
151
|
+
"./microsoft-uet": {
|
|
152
|
+
"types": "./dist-types/vendors/ads-and-pixels/microsoft-uet.d.ts",
|
|
153
|
+
"import": "./dist/vendors/ads-and-pixels/microsoft-uet.js",
|
|
154
|
+
"require": "./dist/vendors/ads-and-pixels/microsoft-uet.cjs"
|
|
155
|
+
},
|
|
156
|
+
"./snapchat-pixel": {
|
|
157
|
+
"types": "./dist-types/vendors/ads-and-pixels/snapchat-pixel.d.ts",
|
|
158
|
+
"import": "./dist/vendors/ads-and-pixels/snapchat-pixel.js",
|
|
159
|
+
"require": "./dist/vendors/ads-and-pixels/snapchat-pixel.cjs"
|
|
160
|
+
},
|
|
161
|
+
"./tiktok-pixel": {
|
|
162
|
+
"types": "./dist-types/vendors/ads-and-pixels/tiktok-pixel.d.ts",
|
|
163
|
+
"import": "./dist/vendors/ads-and-pixels/tiktok-pixel.js",
|
|
164
|
+
"require": "./dist/vendors/ads-and-pixels/tiktok-pixel.cjs"
|
|
165
|
+
},
|
|
166
|
+
"./x-pixel": {
|
|
167
|
+
"types": "./dist-types/vendors/ads-and-pixels/x-pixel.d.ts",
|
|
168
|
+
"import": "./dist/vendors/ads-and-pixels/x-pixel.js",
|
|
169
|
+
"require": "./dist/vendors/ads-and-pixels/x-pixel.cjs"
|
|
170
|
+
},
|
|
171
|
+
"./registry": {
|
|
172
|
+
"types": "./dist-types/registry.d.ts",
|
|
173
|
+
"import": "./dist/registry.js",
|
|
174
|
+
"require": "./dist/registry.cjs"
|
|
175
|
+
},
|
|
15
176
|
"./*": {
|
|
16
177
|
"types": "./dist-types/*.d.ts",
|
|
17
178
|
"import": "./dist/*.js",
|
|
@@ -28,7 +189,7 @@
|
|
|
28
189
|
"dev": "sh -c 'rslib build --no-dts --no-clean && rslib build --watch --no-dts --no-clean'",
|
|
29
190
|
"fmt": "bun biome format --write . && bun biome check --formatter-enabled=false --linter-enabled=false --write",
|
|
30
191
|
"lint": "bun biome lint ./src",
|
|
31
|
-
"test": "vitest run
|
|
192
|
+
"test": "vitest run",
|
|
32
193
|
"test:watch": "vitest"
|
|
33
194
|
},
|
|
34
195
|
"browserslist": [
|
|
@@ -39,7 +200,7 @@
|
|
|
39
200
|
"devDependencies": {
|
|
40
201
|
"@c15t/typescript-config": "0.0.1",
|
|
41
202
|
"@c15t/vitest-config": "1.0.0",
|
|
42
|
-
"c15t": "2.
|
|
203
|
+
"c15t": "2.1.0"
|
|
43
204
|
},
|
|
44
205
|
"publishConfig": {
|
|
45
206
|
"access": "public"
|