@c15t/scripts 1.0.1 → 1.1.0-rc.1
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/dist/databuddy.cjs +105 -50
- package/dist/databuddy.js +99 -47
- package/dist/engine/compile.cjs +126 -0
- package/dist/engine/compile.js +89 -0
- package/dist/engine/runtime.cjs +379 -0
- package/dist/engine/runtime.js +345 -0
- package/dist/google-tag-manager.cjs +80 -96
- package/dist/google-tag-manager.js +74 -87
- package/dist/google-tag.cjs +88 -39
- package/dist/google-tag.js +82 -36
- package/dist/linkedin-insights.cjs +52 -41
- package/dist/linkedin-insights.js +45 -37
- package/dist/meta-pixel.cjs +92 -26
- package/dist/meta-pixel.js +86 -23
- package/dist/microsoft-uet.cjs +92 -52
- package/dist/microsoft-uet.js +86 -49
- package/dist/posthog.cjs +102 -53
- package/dist/posthog.js +96 -50
- package/dist/resolve.cjs +67 -0
- package/dist/resolve.js +33 -0
- package/dist/tiktok-pixel.cjs +93 -27
- package/dist/tiktok-pixel.js +86 -23
- package/dist/types.cjs +47 -0
- package/dist/types.js +7 -0
- package/dist/x-pixel.cjs +49 -19
- package/dist/x-pixel.js +42 -15
- package/dist-types/databuddy.d.ts +144 -0
- package/dist-types/engine/compile.d.ts +3 -0
- package/dist-types/engine/runtime.d.ts +3 -0
- package/dist-types/engine.test.d.ts +1 -0
- package/dist-types/google-tag-manager.d.ts +97 -0
- package/dist-types/google-tag.d.ts +96 -0
- package/dist-types/helpers.test.d.ts +1 -0
- package/dist-types/linkedin-insights.d.ts +79 -0
- package/{dist → dist-types}/meta-pixel.d.ts +61 -14
- package/dist-types/microsoft-uet.d.ts +94 -0
- package/dist-types/posthog.d.ts +112 -0
- package/dist-types/resolve.d.ts +9 -0
- package/dist-types/tiktok-pixel.d.ts +91 -0
- package/dist-types/types.d.ts +259 -0
- package/{dist → dist-types}/x-pixel.d.ts +38 -12
- package/package.json +46 -45
- package/LICENSE.md +0 -595
- package/dist/databuddy.d.ts +0 -104
- package/dist/databuddy.d.ts.map +0 -1
- package/dist/google-tag-manager.d.ts +0 -63
- package/dist/google-tag-manager.d.ts.map +0 -1
- package/dist/google-tag.d.ts +0 -38
- package/dist/google-tag.d.ts.map +0 -1
- package/dist/linkedin-insights.d.ts +0 -48
- package/dist/linkedin-insights.d.ts.map +0 -1
- package/dist/meta-pixel.d.ts.map +0 -1
- package/dist/microsoft-uet.d.ts +0 -40
- package/dist/microsoft-uet.d.ts.map +0 -1
- package/dist/posthog.d.ts +0 -54
- package/dist/posthog.d.ts.map +0 -1
- package/dist/tiktok-pixel.d.ts +0 -44
- package/dist/tiktok-pixel.d.ts.map +0 -1
- package/dist/x-pixel.d.ts.map +0 -1
package/dist/databuddy.d.ts
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import type { Script } from 'c15t';
|
|
2
|
-
declare global {
|
|
3
|
-
interface Window {
|
|
4
|
-
databuddy?: {
|
|
5
|
-
track: (eventName: string, properties?: Record<string, unknown>) => void;
|
|
6
|
-
screenView: (screenName?: string, properties?: Record<string, unknown>) => void;
|
|
7
|
-
clear: () => void;
|
|
8
|
-
flush: () => void;
|
|
9
|
-
setGlobalProperties: (properties: Record<string, unknown>) => void;
|
|
10
|
-
trackCustomEvent: (eventName: string, properties?: Record<string, unknown>) => void;
|
|
11
|
-
options: {
|
|
12
|
-
disabled: boolean;
|
|
13
|
-
[key: string]: unknown;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
databuddyConfig?: {
|
|
17
|
-
clientId?: string;
|
|
18
|
-
apiUrl?: string;
|
|
19
|
-
[key: string]: unknown;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
export interface DatabuddyConsentOptions {
|
|
24
|
-
/**
|
|
25
|
-
* Your Databuddy client ID.
|
|
26
|
-
*/
|
|
27
|
-
clientId: string;
|
|
28
|
-
/**
|
|
29
|
-
* Your Databuddy API URL.
|
|
30
|
-
* @default 'https://basket.databuddy.cc'
|
|
31
|
-
*/
|
|
32
|
-
apiUrl?: string;
|
|
33
|
-
/**
|
|
34
|
-
* The Databuddy script URL.
|
|
35
|
-
* @default 'https://cdn.databuddy.cc/databuddy.js'
|
|
36
|
-
*/
|
|
37
|
-
scriptUrl?: string;
|
|
38
|
-
/**
|
|
39
|
-
* Additional configuration options for Databuddy.
|
|
40
|
-
* @example { trackScreenViews: true, trackOutgoingLinks: true }
|
|
41
|
-
*/
|
|
42
|
-
options?: Record<string, unknown>;
|
|
43
|
-
/**
|
|
44
|
-
* Override or extend the default script values.
|
|
45
|
-
*
|
|
46
|
-
* Default values:
|
|
47
|
-
* - `id`: 'databuddy'
|
|
48
|
-
* - `category`: 'measurement'
|
|
49
|
-
*/
|
|
50
|
-
script?: Partial<Script>;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Loads the Databuddy script and manages consent state through a comprehensive lifecycle.
|
|
54
|
-
*
|
|
55
|
-
* This function orchestrates consent-aware analytics by coordinating between c15t's consent
|
|
56
|
-
* state and Databuddy's tracking behavior. The consent management lifecycle works as follows:
|
|
57
|
-
*
|
|
58
|
-
* 1. **Before Script Load** (`onBeforeLoad`): Seeds `window.databuddyConfig` with the client
|
|
59
|
-
* configuration, including setting `disabled: !hasConsent` to ensure Databuddy initializes
|
|
60
|
-
* in the correct state. The Databuddy script reads this configuration object on initialization.
|
|
61
|
-
*
|
|
62
|
-
* 2. **On Script Load** (`onLoad`): After Databuddy has initialized, verifies that
|
|
63
|
-
* `window.databuddy.options.disabled` matches the current consent state by calling
|
|
64
|
-
* `handleConsentOpt()`.
|
|
65
|
-
*
|
|
66
|
-
* 3. **On Consent Change** (`onConsentChange`): Dynamically toggles `window.databuddy.options.disabled`
|
|
67
|
-
* to enable tracking when consent is granted or disable tracking when consent is revoked.
|
|
68
|
-
* This ensures real-time compliance with user preferences.
|
|
69
|
-
*
|
|
70
|
-
* The script always loads (`alwaysLoad: true`) but tracking is controlled via the `disabled` flag,
|
|
71
|
-
* allowing Databuddy to remain present in the DOM while respecting consent boundaries.
|
|
72
|
-
*
|
|
73
|
-
* @param options - Configuration for the Databuddy consent script
|
|
74
|
-
* @returns The Databuddy script configuration object for c15t's script loader
|
|
75
|
-
*
|
|
76
|
-
* @throws This function does not throw errors directly. However, network failures or script
|
|
77
|
-
* loading errors may cause the Databuddy script to fail silently without initializing
|
|
78
|
-
* `window.databuddy`. The lifecycle callbacks handle these cases gracefully by checking for
|
|
79
|
-
* the presence of `window.databuddy` before attempting to modify its state.
|
|
80
|
-
*
|
|
81
|
-
* @example
|
|
82
|
-
* ```ts
|
|
83
|
-
* import { configureConsentManager } from 'c15t';
|
|
84
|
-
* import { databuddy } from '@c15t/scripts/databuddy';
|
|
85
|
-
*
|
|
86
|
-
* configureConsentManager({
|
|
87
|
-
* scripts: [
|
|
88
|
-
* databuddy({
|
|
89
|
-
* clientId: 'db_1234567890abcdef',
|
|
90
|
-
* // scriptUrl: 'https://cdn.databuddy.cc/databuddy.js', // Optional, defaults to cdn.databuddy.cc
|
|
91
|
-
* // apiUrl: 'https://basket.databuddy.cc', // Optional, defaults to basket.databuddy.cc
|
|
92
|
-
* options: {
|
|
93
|
-
* trackScreenViews: true,
|
|
94
|
-
* trackOutgoingLinks: true,
|
|
95
|
-
* trackPerformance: true,
|
|
96
|
-
* samplingRate: 1.0,
|
|
97
|
-
* },
|
|
98
|
-
* }),
|
|
99
|
-
* ],
|
|
100
|
-
* });
|
|
101
|
-
* ```
|
|
102
|
-
*/
|
|
103
|
-
export declare function databuddy(options: DatabuddyConsentOptions): Script;
|
|
104
|
-
//# sourceMappingURL=databuddy.d.ts.map
|
package/dist/databuddy.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"databuddy.d.ts","sourceRoot":"","sources":["../src/databuddy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,OAAO,CAAC,MAAM,CAAC;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;;;;;;;;;;;;;GAkDG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM,CAyDlE"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import type { ConsentState, Script } from 'c15t';
|
|
2
|
-
declare global {
|
|
3
|
-
interface Window {
|
|
4
|
-
dataLayer: unknown[];
|
|
5
|
-
gtag: (...args: unknown[]) => void;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
interface GTMConsentConfiguration {
|
|
9
|
-
ad_storage: 'granted' | 'denied';
|
|
10
|
-
ad_personalization: 'granted' | 'denied';
|
|
11
|
-
ad_user_data: 'granted' | 'denied';
|
|
12
|
-
analytics_storage: 'granted' | 'denied';
|
|
13
|
-
personalization_storage: 'granted' | 'denied';
|
|
14
|
-
functionality_storage: 'granted' | 'denied';
|
|
15
|
-
security_storage: 'granted' | 'denied';
|
|
16
|
-
}
|
|
17
|
-
export declare const DEFAULT_GTM_CONSENT_CONFIG: GTMConsentConfiguration;
|
|
18
|
-
/**
|
|
19
|
-
* Converts ConsentState to GTM consent configuration
|
|
20
|
-
*
|
|
21
|
-
* @param consentState - The application's consent state
|
|
22
|
-
* @returns GTM-compatible consent configuration
|
|
23
|
-
*
|
|
24
|
-
* @see {@link CONSENT_STATE_TO_GTM_MAPPING} for the mapping logic
|
|
25
|
-
*/
|
|
26
|
-
export declare function mapConsentStateToGTM(consentState: ConsentState): GTMConsentConfiguration;
|
|
27
|
-
export interface GoogleTagManagerOptions {
|
|
28
|
-
/**
|
|
29
|
-
* Your Google Tag Manager container ID. Begins with 'GTM-'.
|
|
30
|
-
* @example `GTM-1234XXX`
|
|
31
|
-
*/
|
|
32
|
-
id: string;
|
|
33
|
-
/**
|
|
34
|
-
* Update Event Name
|
|
35
|
-
* A custom event name used as a trigger to load your script once the consent has been updated.
|
|
36
|
-
*
|
|
37
|
-
* @default 'consent-update'
|
|
38
|
-
* @example 'consent-update'
|
|
39
|
-
*/
|
|
40
|
-
updateEventName?: string;
|
|
41
|
-
/**
|
|
42
|
-
* Override or extend the default script values.
|
|
43
|
-
*
|
|
44
|
-
* Default values:
|
|
45
|
-
* - `id`: 'google-tag-manager'
|
|
46
|
-
* - `src`: `https://www.googletagmanager.com/gtm.js?id=${id}`
|
|
47
|
-
* - `category`: 'necessary' (You control what scripts get loaded via Google Tag Manager)
|
|
48
|
-
* - `alwaysLoad`: true
|
|
49
|
-
* - `async`: true
|
|
50
|
-
*/
|
|
51
|
-
script?: Partial<Script>;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Creates a Google Tag Manager script.
|
|
55
|
-
* GTM can be used for managing the consent of other scripts via Google Tag Manager consent mode.
|
|
56
|
-
* We recommend using c15t's script loader instead so your script logic is centralised.
|
|
57
|
-
*
|
|
58
|
-
* @param options - The options for the Google Tag Manager script.
|
|
59
|
-
* @returns The Google Tag Manager script.
|
|
60
|
-
*/
|
|
61
|
-
export declare function googleTagManager({ id, script, updateEventName, }: GoogleTagManagerOptions): Script;
|
|
62
|
-
export {};
|
|
63
|
-
//# sourceMappingURL=google-tag-manager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"google-tag-manager.d.ts","sourceRoot":"","sources":["../src/google-tag-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,YAAY,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGlE,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,SAAS,EAAE,OAAO,EAAE,CAAC;QACrB,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;KACnC;CACD;AAGD,UAAU,uBAAuB;IAChC,UAAU,EAAE,SAAS,GAAG,QAAQ,CAAC;IACjC,kBAAkB,EAAE,SAAS,GAAG,QAAQ,CAAC;IACzC,YAAY,EAAE,SAAS,GAAG,QAAQ,CAAC;IACnC,iBAAiB,EAAE,SAAS,GAAG,QAAQ,CAAC;IACxC,uBAAuB,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC9C,qBAAqB,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5C,gBAAgB,EAAE,SAAS,GAAG,QAAQ,CAAC;CACvC;AAGD,eAAO,MAAM,0BAA0B,EAAE,uBAQ/B,CAAC;AAaX;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CACnC,YAAY,EAAE,YAAY,GACxB,uBAAuB,CAczB;AAED,MAAM,WAAW,uBAAuB;IACvC;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,EAChC,EAAE,EACF,MAAM,EACN,eAAe,GACf,EAAE,uBAAuB,GAAG,MAAM,CAwElC"}
|
package/dist/google-tag.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { AllConsentNames, Script } from 'c15t';
|
|
2
|
-
declare global {
|
|
3
|
-
interface Window {
|
|
4
|
-
dataLayer: unknown[];
|
|
5
|
-
gtag: (...args: unknown[]) => void;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
export interface GtagOptions {
|
|
9
|
-
/**
|
|
10
|
-
* Your gtag id
|
|
11
|
-
* @example `G-XXXXXXX`
|
|
12
|
-
*/
|
|
13
|
-
id: string;
|
|
14
|
-
/**
|
|
15
|
-
* The consent category to use for the gtag script. This is typically marketing (Ads & Floodlight) or measurement (Analytics)
|
|
16
|
-
* @example 'marketing'
|
|
17
|
-
*/
|
|
18
|
-
category: AllConsentNames;
|
|
19
|
-
/**
|
|
20
|
-
* Override or extend the default script values.
|
|
21
|
-
*
|
|
22
|
-
* Default values:
|
|
23
|
-
* - `id`: 'gtag'
|
|
24
|
-
* - `src`: `https://www.googletagmanager.com/gtag/js?id=${id}`
|
|
25
|
-
* - `async`: true
|
|
26
|
-
* - `alwaysLoad`: true
|
|
27
|
-
*/
|
|
28
|
-
script?: Partial<Omit<Script, 'category'>>;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Creates a Google Tag (gtag.js) script.
|
|
32
|
-
* Allows you to send data website to linked Google products like Analytics, Ads & Floodlight.
|
|
33
|
-
*
|
|
34
|
-
* @param options - The options for the gtag script.
|
|
35
|
-
* @returns The Google Tag Manager script.
|
|
36
|
-
*/
|
|
37
|
-
export declare function gtag({ id, script, category }: GtagOptions): Script;
|
|
38
|
-
//# sourceMappingURL=google-tag.d.ts.map
|
package/dist/google-tag.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"google-tag.d.ts","sourceRoot":"","sources":["../src/google-tag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAQpD,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,SAAS,EAAE,OAAO,EAAE,CAAC;QACrB,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;KACnC;CACD;AAED,MAAM,WAAW,WAAW;IAC3B;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;OAGG;IACH,QAAQ,EAAE,eAAe,CAAC;IAE1B;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;CAC3C;AAED;;;;;;GAMG;AACH,wBAAgB,IAAI,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,WAAW,GAAG,MAAM,CAsDlE"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { Script } from 'c15t';
|
|
2
|
-
declare global {
|
|
3
|
-
interface Window {
|
|
4
|
-
lintrk: ((...args: unknown[]) => void) & {
|
|
5
|
-
q?: unknown[][];
|
|
6
|
-
};
|
|
7
|
-
_linkedin_partner_id?: string;
|
|
8
|
-
_linkedin_data_partner_ids?: string[];
|
|
9
|
-
ORIBILI?: {
|
|
10
|
-
_DEBUG?: {
|
|
11
|
-
disableScript?: () => void;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
export interface LinkedInInsightsOptions {
|
|
17
|
-
/**
|
|
18
|
-
* Your LinkedIn Insights ID
|
|
19
|
-
* @example `123456789012345`
|
|
20
|
-
*/
|
|
21
|
-
id: string;
|
|
22
|
-
/**
|
|
23
|
-
* Override or extend the default script values.
|
|
24
|
-
*
|
|
25
|
-
* Default values:
|
|
26
|
-
* - `id`: 'linkedin-insights'
|
|
27
|
-
* - `src`: `https://snap.licdn.com/li.lms-analytics/insight.min.js`
|
|
28
|
-
* - `category`: 'marketing'
|
|
29
|
-
*/
|
|
30
|
-
script?: Partial<Script>;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* LinkedIn Insights Script
|
|
34
|
-
*
|
|
35
|
-
* @param options - The options for the LinkedIn Insights script
|
|
36
|
-
* @returns The LinkedIn Insights script configuration
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* ```ts
|
|
40
|
-
* const linkedinInsightsScript = linkedinInsights({
|
|
41
|
-
* id: '123456789012345',
|
|
42
|
-
* });
|
|
43
|
-
* ```
|
|
44
|
-
*
|
|
45
|
-
* @see {@link https://business.linkedin.com/marketing-solutions/ad-libraries/insights} LinkedIn Insights documentation
|
|
46
|
-
*/
|
|
47
|
-
export declare function linkedinInsights({ id, script, }: LinkedInInsightsOptions): Script;
|
|
48
|
-
//# sourceMappingURL=linkedin-insights.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"linkedin-insights.d.ts","sourceRoot":"","sources":["../src/linkedin-insights.ts"],"names":[],"mappings":"AAAA,OAAO,KAA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mB,CAAC;AAG1D,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,GAAG,EAAE;YACJ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;YACzC,CACC,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,iBAAiB,EAC5B,MAAM,CAAC,EAAE,mBAAmB,CAAC,iBAAiB,CAAC,EAC/C,OAAO,CAAC,EAAE,MAAM,GACd,IAAI,CAAC;YACR,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC;YACvD,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;SAC3B,CAAC;QACF,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;KACpB;CACD;AAED,MAAM,WAAW,gBAAgB;IAChC;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,gBAAgB,GAAG,MAAM,CA6BvE;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU,SAAS,iBAAiB,EAClE,WAAW,UAAU,EACrB,SAAS,mBAAmB,CAAC,UAAU,CAAC,EACxC,UAAU,MAAM,SACmC,CAAC"}
|
package/dist/microsoft-uet.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { Script } from 'c15t';
|
|
2
|
-
declare global {
|
|
3
|
-
interface Window {
|
|
4
|
-
uetq: unknown[] | undefined;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
export interface MicrosoftUetOptions {
|
|
8
|
-
/**
|
|
9
|
-
* Your Microsoft UET ID
|
|
10
|
-
* @example `123456789012345`
|
|
11
|
-
*/
|
|
12
|
-
id: string;
|
|
13
|
-
/**
|
|
14
|
-
* Override or extend the default script values.
|
|
15
|
-
*
|
|
16
|
-
* Default values:
|
|
17
|
-
* - `id`: 'microsoft-uet'
|
|
18
|
-
* - `src`: `//bat.bing.com/bat.js`
|
|
19
|
-
* - `category`: 'marketing'
|
|
20
|
-
*/
|
|
21
|
-
script?: Partial<Script>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Microsoft UET Script
|
|
25
|
-
* This script is persistent after consent is revoked because it has built-in functionality to opt into and out of tracking based on consent, which allows us to not need to load the script again when consent is revoked.
|
|
26
|
-
*
|
|
27
|
-
* @param options - The options for the Microsoft UET script
|
|
28
|
-
* @returns The Microsoft UET script configuration
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* ```ts
|
|
32
|
-
* const microsoftUetScript = microsoftUet({
|
|
33
|
-
* id: '123456789012345',
|
|
34
|
-
* });
|
|
35
|
-
* ```
|
|
36
|
-
*
|
|
37
|
-
* @see https://learn.microsoft.com/en-us/advertising/guides/universal-event-tracking?view=bingads-13
|
|
38
|
-
*/
|
|
39
|
-
export declare function microsoftUet({ id, script }: MicrosoftUetOptions): Script;
|
|
40
|
-
//# sourceMappingURL=microsoft-uet.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"microsoft-uet.d.ts","sourceRoot":"","sources":["../src/microsoft-uet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,IAAI,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC;KAC5B;CACD;AAED,MAAM,WAAW,mBAAmB;IACnC;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CACzB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,mBAAmB,GAAG,MAAM,CAkExE"}
|
package/dist/posthog.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { Script } from 'c15t';
|
|
2
|
-
declare global {
|
|
3
|
-
interface Window {
|
|
4
|
-
posthog: {
|
|
5
|
-
init: (token: string, options: {
|
|
6
|
-
api_host: string;
|
|
7
|
-
ui_host?: string;
|
|
8
|
-
autocapture?: boolean;
|
|
9
|
-
[key: string]: unknown;
|
|
10
|
-
}) => void;
|
|
11
|
-
opt_in_capturing: () => void;
|
|
12
|
-
opt_out_capturing: () => void;
|
|
13
|
-
get_explicit_consent_status: () => string;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export interface PosthogConsentOptions {
|
|
18
|
-
/**
|
|
19
|
-
* Your posthog id, begins with 'phc_'.
|
|
20
|
-
*/
|
|
21
|
-
id: string;
|
|
22
|
-
/**
|
|
23
|
-
* Your posthog api host.
|
|
24
|
-
* @default 'https://eu.i.posthog.com'
|
|
25
|
-
*/
|
|
26
|
-
apiHost: string;
|
|
27
|
-
/**
|
|
28
|
-
* The defaults for the posthog script.
|
|
29
|
-
*/
|
|
30
|
-
defaults: string;
|
|
31
|
-
/**
|
|
32
|
-
* Other optional options for the posthog script.
|
|
33
|
-
* @example { person_profiles: 'identified_only' }
|
|
34
|
-
*/
|
|
35
|
-
options: Record<string, unknown>;
|
|
36
|
-
/**
|
|
37
|
-
* Override or extend the default script values.
|
|
38
|
-
*
|
|
39
|
-
* Default values:
|
|
40
|
-
* - `id`: 'posthog-consent'
|
|
41
|
-
* - `category`: 'measurement'
|
|
42
|
-
*/
|
|
43
|
-
script?: Partial<Script>;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Loads the PostHog script and initializes it with the given options.
|
|
47
|
-
* This uses posthog.opt_in_capturing() to opt in to capturing. And posthog.opt_out_capturing() to opt out of capturing.
|
|
48
|
-
* @see https://posthog.com/docs/libraries/js#opt-in-capturing
|
|
49
|
-
*
|
|
50
|
-
* @param options - Optional configuration for the PostHog consent script
|
|
51
|
-
* @returns The Posthog script
|
|
52
|
-
*/
|
|
53
|
-
export declare function posthog(options: PosthogConsentOptions): Script;
|
|
54
|
-
//# sourceMappingURL=posthog.d.ts.map
|
package/dist/posthog.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"posthog.d.ts","sourceRoot":"","sources":["../src/posthog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,OAAO,EAAE;YACR,IAAI,EAAE,CACL,KAAK,EAAE,MAAM,EACb,OAAO,EAAE;gBACR,QAAQ,EAAE,MAAM,CAAC;gBACjB,OAAO,CAAC,EAAE,MAAM,CAAC;gBACjB,WAAW,CAAC,EAAE,OAAO,CAAC;gBACtB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;aACvB,KACG,IAAI,CAAC;YACV,gBAAgB,EAAE,MAAM,IAAI,CAAC;YAC7B,iBAAiB,EAAE,MAAM,IAAI,CAAC;YAC9B,2BAA2B,EAAE,MAAM,MAAM,CAAC;SAC1C,CAAC;KACF;CACD;AAED,MAAM,WAAW,qBAAqB;IACrC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEjC;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,qBAAqB,GAAG,MAAM,CAkE9D"}
|
package/dist/tiktok-pixel.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { Script } from 'c15t';
|
|
2
|
-
declare global {
|
|
3
|
-
interface Window {
|
|
4
|
-
ttq: {
|
|
5
|
-
grantConsent: () => void;
|
|
6
|
-
revokeConsent: () => void;
|
|
7
|
-
page: () => void;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
export interface TikTokPixelOptions {
|
|
12
|
-
/**
|
|
13
|
-
* Your TikTok Pixel ID
|
|
14
|
-
* @example `123456789012345`
|
|
15
|
-
*/
|
|
16
|
-
pixelId: string;
|
|
17
|
-
/**
|
|
18
|
-
* Override or extend the default script values.
|
|
19
|
-
*
|
|
20
|
-
* Default values:
|
|
21
|
-
* - `id`: 'tiktok-pixel'
|
|
22
|
-
* - `src`: `https://analytics.tiktok.com/i18n/pixel/events.js`
|
|
23
|
-
* - `category`: 'marketing'
|
|
24
|
-
*/
|
|
25
|
-
script?: Partial<Script>;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Creates a Tiktok Pixel script.
|
|
29
|
-
* This script is persistent after consent is revoked because it has built-in functionality to opt into and out of tracking based on consent, which allows us to not need to load the script again when consent is revoked.
|
|
30
|
-
*
|
|
31
|
-
* @param options - The options for the TikTok Pixel script
|
|
32
|
-
* @returns The TikTok Pixel script configuration
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* ```ts
|
|
36
|
-
* const tiktokPixelScript = tiktokPixel({
|
|
37
|
-
* pixelId: '123456789012345',
|
|
38
|
-
* });
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
|
-
* @see {@link https://ads.tiktok.com/help/article/tiktok-pixel} TikTok Pixel documentation
|
|
42
|
-
*/
|
|
43
|
-
export declare function tiktokPixel({ pixelId, script }: TikTokPixelOptions): Script;
|
|
44
|
-
//# sourceMappingURL=tiktok-pixel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tiktok-pixel.d.ts","sourceRoot":"","sources":["../src/tiktok-pixel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,GAAG,EAAE;YACJ,YAAY,EAAE,MAAM,IAAI,CAAC;YACzB,aAAa,EAAE,MAAM,IAAI,CAAC;YAC1B,IAAI,EAAE,MAAM,IAAI,CAAC;SACjB,CAAC;KACF;CACD;AAED,MAAM,WAAW,kBAAkB;IAClC;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CACzB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,kBAAkB,GAAG,MAAM,CA+B3E"}
|
package/dist/x-pixel.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"x-pixel.d.ts","sourceRoot":"","sources":["../src/x-pixel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,MAAM,WAAW,aAAa;IAC7B;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC1B;AACD,MAAM,WAAW,WAAW;IAC3B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;I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