@codefast/tracking 0.7.0 → 0.7.2
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/CHANGELOG.md +21 -0
- package/README.md +235 -105
- package/dist/adapters/tanstack-start.d.ts +12 -9
- package/dist/adapters/tanstack-start.js +5 -6
- package/dist/client/ad-framework-consent.d.ts +9 -8
- package/dist/client/ad-framework-consent.js +4 -5
- package/dist/client/browser-cookie.d.ts +2 -3
- package/dist/client/browser-cookie.js +2 -3
- package/dist/client/consent-runtime.d.ts +6 -5
- package/dist/client/consent-runtime.js +2 -3
- package/dist/client/consent-storage.d.ts +1 -2
- package/dist/client/consent-storage.js +1 -2
- package/dist/client/consent-withdrawal.d.ts +5 -4
- package/dist/client/consent-withdrawal.js +2 -3
- package/dist/client/cookie-anonymous-id.d.ts +8 -5
- package/dist/client/cookie-anonymous-id.js +2 -3
- package/dist/client/create-client-tracker.d.ts +8 -3
- package/dist/client/create-client-tracker.js +3 -2
- package/dist/client/gpc.d.ts +1 -2
- package/dist/client/gpc.js +1 -2
- package/dist/client/initial-consent-store.d.ts +7 -6
- package/dist/client/initial-consent-store.js +2 -3
- package/dist/client/is-analytics-allowed.d.ts +5 -4
- package/dist/client/is-analytics-allowed.js +2 -3
- package/dist/client/server-persisted-anonymous-id.d.ts +5 -4
- package/dist/client/server-persisted-anonymous-id.js +2 -3
- package/dist/core/consent-config.d.ts +3 -4
- package/dist/core/consent-config.js +2 -3
- package/dist/core/consent-receipt.d.ts +7 -8
- package/dist/core/consent-receipt.js +2 -3
- package/dist/core/consent.d.ts +24 -13
- package/dist/core/consent.js +13 -10
- package/dist/core/cookie.d.ts +3 -4
- package/dist/core/cookie.js +3 -4
- package/dist/core/destination.d.ts +1 -2
- package/dist/core/destination.js +1 -2
- package/dist/core/event-catalog.d.ts +2 -3
- package/dist/core/event-catalog.js +2 -3
- package/dist/core/event-id.d.ts +1 -2
- package/dist/core/event-id.js +1 -2
- package/dist/core/tracked-event.d.ts +1 -2
- package/dist/core/tracked-event.js +1 -2
- package/dist/destinations/ad-consent.d.ts +3 -4
- package/dist/destinations/ad-consent.js +2 -3
- package/dist/destinations/google-analytics.d.ts +17 -10
- package/dist/destinations/google-analytics.js +5 -6
- package/dist/destinations/google-consent.d.ts +10 -9
- package/dist/destinations/google-consent.js +6 -7
- package/dist/destinations/meta.d.ts +8 -7
- package/dist/destinations/meta.js +3 -4
- package/dist/destinations/microsoft-uet.d.ts +8 -7
- package/dist/destinations/microsoft-uet.js +3 -4
- package/dist/destinations/shared.d.ts +8 -5
- package/dist/destinations/shared.js +4 -3
- package/dist/destinations/tiktok.d.ts +8 -7
- package/dist/destinations/tiktok.js +3 -4
- package/dist/destinations/vercel-analytics.d.ts +4 -3
- package/dist/destinations/vercel-analytics.js +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -2
- package/dist/react/consent-banner.d.ts +29 -2
- package/dist/react/consent-banner.js +12 -9
- package/dist/react/gtag-consent-bootstrap.d.ts +5 -4
- package/dist/react/gtag-consent-bootstrap.js +2 -3
- package/dist/react/use-consent.d.ts +5 -2
- package/dist/react/use-consent.js +1 -2
- package/dist/react/use-google-consent-sync.d.ts +5 -4
- package/dist/react/use-google-consent-sync.js +2 -3
- package/dist/react/use-initial-consent.d.ts +2 -3
- package/dist/react/use-initial-consent.js +2 -3
- package/dist/server/anonymous-id-cookie.d.ts +8 -7
- package/dist/server/anonymous-id-cookie.js +5 -6
- package/dist/server/consent-receipt-store.d.ts +5 -6
- package/dist/server/consent-receipt-store.js +3 -4
- package/dist/server/consent-receipt.d.ts +5 -6
- package/dist/server/consent-receipt.js +4 -5
- package/dist/server/initial-consent.d.ts +5 -4
- package/dist/server/initial-consent.js +2 -3
- package/dist/server/measurement-protocol.d.ts +10 -9
- package/dist/server/measurement-protocol.js +4 -5
- package/dist/server/region.d.ts +3 -4
- package/dist/server/region.js +3 -4
- package/dist/server/user-deletion.d.ts +10 -7
- package/dist/server/user-deletion.js +3 -4
- package/dist/tooling/import-protection.d.ts +2 -3
- package/dist/tooling/import-protection.js +2 -3
- package/package.json +11 -62
- package/dist/adapters/tanstack-start.d.ts.map +0 -1
- package/dist/adapters/tanstack-start.js.map +0 -1
- package/dist/client/ad-framework-consent.d.ts.map +0 -1
- package/dist/client/ad-framework-consent.js.map +0 -1
- package/dist/client/browser-cookie.d.ts.map +0 -1
- package/dist/client/browser-cookie.js.map +0 -1
- package/dist/client/consent-runtime.d.ts.map +0 -1
- package/dist/client/consent-runtime.js.map +0 -1
- package/dist/client/consent-storage.d.ts.map +0 -1
- package/dist/client/consent-storage.js.map +0 -1
- package/dist/client/consent-withdrawal.d.ts.map +0 -1
- package/dist/client/consent-withdrawal.js.map +0 -1
- package/dist/client/cookie-anonymous-id.d.ts.map +0 -1
- package/dist/client/cookie-anonymous-id.js.map +0 -1
- package/dist/client/create-client-tracker.d.ts.map +0 -1
- package/dist/client/create-client-tracker.js.map +0 -1
- package/dist/client/gpc.d.ts.map +0 -1
- package/dist/client/gpc.js.map +0 -1
- package/dist/client/initial-consent-store.d.ts.map +0 -1
- package/dist/client/initial-consent-store.js.map +0 -1
- package/dist/client/is-analytics-allowed.d.ts.map +0 -1
- package/dist/client/is-analytics-allowed.js.map +0 -1
- package/dist/client/server-persisted-anonymous-id.d.ts.map +0 -1
- package/dist/client/server-persisted-anonymous-id.js.map +0 -1
- package/dist/core/consent-config.d.ts.map +0 -1
- package/dist/core/consent-config.js.map +0 -1
- package/dist/core/consent-receipt.d.ts.map +0 -1
- package/dist/core/consent-receipt.js.map +0 -1
- package/dist/core/consent.d.ts.map +0 -1
- package/dist/core/consent.js.map +0 -1
- package/dist/core/cookie.d.ts.map +0 -1
- package/dist/core/cookie.js.map +0 -1
- package/dist/core/destination.d.ts.map +0 -1
- package/dist/core/destination.js.map +0 -1
- package/dist/core/event-catalog.d.ts.map +0 -1
- package/dist/core/event-catalog.js.map +0 -1
- package/dist/core/event-id.d.ts.map +0 -1
- package/dist/core/event-id.js.map +0 -1
- package/dist/core/tracked-event.d.ts.map +0 -1
- package/dist/core/tracked-event.js.map +0 -1
- package/dist/destinations/ad-consent.d.ts.map +0 -1
- package/dist/destinations/ad-consent.js.map +0 -1
- package/dist/destinations/google-analytics.d.ts.map +0 -1
- package/dist/destinations/google-analytics.js.map +0 -1
- package/dist/destinations/google-consent.d.ts.map +0 -1
- package/dist/destinations/google-consent.js.map +0 -1
- package/dist/destinations/meta.d.ts.map +0 -1
- package/dist/destinations/meta.js.map +0 -1
- package/dist/destinations/microsoft-uet.d.ts.map +0 -1
- package/dist/destinations/microsoft-uet.js.map +0 -1
- package/dist/destinations/shared.d.ts.map +0 -1
- package/dist/destinations/shared.js.map +0 -1
- package/dist/destinations/tiktok.d.ts.map +0 -1
- package/dist/destinations/tiktok.js.map +0 -1
- package/dist/destinations/vercel-analytics.d.ts.map +0 -1
- package/dist/destinations/vercel-analytics.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/react/consent-banner.d.ts.map +0 -1
- package/dist/react/consent-banner.js.map +0 -1
- package/dist/react/gtag-consent-bootstrap.d.ts.map +0 -1
- package/dist/react/gtag-consent-bootstrap.js.map +0 -1
- package/dist/react/use-consent.d.ts.map +0 -1
- package/dist/react/use-consent.js.map +0 -1
- package/dist/react/use-google-consent-sync.d.ts.map +0 -1
- package/dist/react/use-google-consent-sync.js.map +0 -1
- package/dist/react/use-initial-consent.d.ts.map +0 -1
- package/dist/react/use-initial-consent.js.map +0 -1
- package/dist/server/anonymous-id-cookie.d.ts.map +0 -1
- package/dist/server/anonymous-id-cookie.js.map +0 -1
- package/dist/server/consent-receipt-store.d.ts.map +0 -1
- package/dist/server/consent-receipt-store.js.map +0 -1
- package/dist/server/consent-receipt.d.ts.map +0 -1
- package/dist/server/consent-receipt.js.map +0 -1
- package/dist/server/initial-consent.d.ts.map +0 -1
- package/dist/server/initial-consent.js.map +0 -1
- package/dist/server/measurement-protocol.d.ts.map +0 -1
- package/dist/server/measurement-protocol.js.map +0 -1
- package/dist/server/region.d.ts.map +0 -1
- package/dist/server/region.js.map +0 -1
- package/dist/server/user-deletion.d.ts.map +0 -1
- package/dist/server/user-deletion.js.map +0 -1
- package/dist/tooling/import-protection.d.ts.map +0 -1
- package/dist/tooling/import-protection.js.map +0 -1
- package/src/adapters/tanstack-start.ts +0 -135
- package/src/client/ad-framework-consent.ts +0 -86
- package/src/client/browser-cookie.ts +0 -16
- package/src/client/consent-runtime.ts +0 -80
- package/src/client/consent-storage.ts +0 -125
- package/src/client/consent-withdrawal.ts +0 -32
- package/src/client/cookie-anonymous-id.ts +0 -112
- package/src/client/create-client-tracker.ts +0 -168
- package/src/client/gpc.ts +0 -15
- package/src/client/initial-consent-store.ts +0 -218
- package/src/client/is-analytics-allowed.ts +0 -43
- package/src/client/server-persisted-anonymous-id.ts +0 -102
- package/src/core/consent-config.ts +0 -27
- package/src/core/consent-receipt.ts +0 -115
- package/src/core/consent.ts +0 -286
- package/src/core/cookie.ts +0 -29
- package/src/core/destination.ts +0 -29
- package/src/core/event-catalog.ts +0 -54
- package/src/core/event-id.ts +0 -8
- package/src/core/tracked-event.ts +0 -14
- package/src/css/consent.css +0 -119
- package/src/destinations/ad-consent.ts +0 -29
- package/src/destinations/google-analytics.ts +0 -296
- package/src/destinations/google-consent.ts +0 -164
- package/src/destinations/meta.ts +0 -96
- package/src/destinations/microsoft-uet.ts +0 -86
- package/src/destinations/shared.ts +0 -45
- package/src/destinations/tiktok.ts +0 -85
- package/src/destinations/vercel-analytics.ts +0 -39
- package/src/index.ts +0 -171
- package/src/react/consent-banner.tsx +0 -360
- package/src/react/gtag-consent-bootstrap.tsx +0 -48
- package/src/react/use-consent.ts +0 -119
- package/src/react/use-google-consent-sync.ts +0 -38
- package/src/react/use-initial-consent.ts +0 -22
- package/src/server/anonymous-id-cookie.ts +0 -103
- package/src/server/consent-receipt-store.ts +0 -79
- package/src/server/consent-receipt.ts +0 -89
- package/src/server/initial-consent.ts +0 -46
- package/src/server/measurement-protocol.ts +0 -114
- package/src/server/region.ts +0 -77
- package/src/server/user-deletion.ts +0 -93
- package/src/tooling/import-protection.ts +0 -22
package/dist/core/consent.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Every consent region, in a stable order shared by guards and iteration.
|
|
3
|
+
*
|
|
4
|
+
* @since 0.5.0-canary.6
|
|
3
5
|
*/
|
|
4
6
|
export const CONSENT_REGIONS = ["eu", "other", "us", "vn"];
|
|
5
7
|
/**
|
|
6
8
|
* Guards a region read from untrusted storage (a cached `InitialConsent`, a cookie).
|
|
7
9
|
*
|
|
8
|
-
* @since
|
|
10
|
+
* @since 0.5.0-canary.6
|
|
9
11
|
*/
|
|
10
12
|
export function isConsentRegion(value) {
|
|
11
13
|
return CONSENT_REGIONS.includes(value);
|
|
@@ -30,6 +32,8 @@ export function resolveConsentMode(region) {
|
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
34
|
/**
|
|
35
|
+
* Every consent category, in a stable order shared by guards and iteration.
|
|
36
|
+
*
|
|
33
37
|
* @since 0.5.0-canary.4
|
|
34
38
|
*/
|
|
35
39
|
export const CONSENT_CATEGORIES = ["ads", "analytics"];
|
|
@@ -57,7 +61,7 @@ export function isConsentDecision(value) {
|
|
|
57
61
|
* dropped, every category becomes an explicit boolean. The one normalization rule every
|
|
58
62
|
* reader of stored consent shares (e.g. `readStoredDecision`).
|
|
59
63
|
*
|
|
60
|
-
* @since
|
|
64
|
+
* @since 0.5.0-canary.6
|
|
61
65
|
*/
|
|
62
66
|
export function normalizeConsentDecision(decision) {
|
|
63
67
|
return createConsentDecision(CONSENT_CATEGORIES.filter((category) => decision[category]));
|
|
@@ -65,7 +69,7 @@ export function normalizeConsentDecision(decision) {
|
|
|
65
69
|
/**
|
|
66
70
|
* Guards a persisted consent record read from untrusted storage (e.g. `localStorage`).
|
|
67
71
|
*
|
|
68
|
-
* @since
|
|
72
|
+
* @since 0.5.0-canary.6
|
|
69
73
|
*/
|
|
70
74
|
export function isConsentRecord(value) {
|
|
71
75
|
return (isPlainObject(value) &&
|
|
@@ -100,7 +104,7 @@ export function resolveDefaultConsent(options) {
|
|
|
100
104
|
* Prerendered/CDN-cached markup must carry nothing region-specific, and a missing geo
|
|
101
105
|
* header means "unknown visitor", never "known non-EU visitor".
|
|
102
106
|
*
|
|
103
|
-
* @since
|
|
107
|
+
* @since 0.5.0-canary.6
|
|
104
108
|
*/
|
|
105
109
|
export const STRICTEST_INITIAL_CONSENT = Object.freeze({
|
|
106
110
|
defaultConsent: Object.freeze(createConsentDecision([])),
|
|
@@ -113,7 +117,7 @@ export const STRICTEST_INITIAL_CONSENT = Object.freeze({
|
|
|
113
117
|
* {@link STRICTEST_INITIAL_CONSENT}'s own pairing — stricter than the region's usual
|
|
114
118
|
* mode, never looser.
|
|
115
119
|
*
|
|
116
|
-
* @since
|
|
120
|
+
* @since 0.5.0-canary.6
|
|
117
121
|
*/
|
|
118
122
|
export function isInitialConsent(value) {
|
|
119
123
|
if (!isPlainObject(value)) {
|
|
@@ -134,7 +138,7 @@ export function isInitialConsent(value) {
|
|
|
134
138
|
* any tampered extra keys — `undefined` if there is none yet, the record is malformed, or
|
|
135
139
|
* it was recorded under a superseded policy version.
|
|
136
140
|
*
|
|
137
|
-
* @since
|
|
141
|
+
* @since 0.5.0-canary.6
|
|
138
142
|
*/
|
|
139
143
|
export function readStoredDecision(storage, policyVersion) {
|
|
140
144
|
const record = storage.load();
|
|
@@ -149,11 +153,10 @@ export function readStoredDecision(storage, policyVersion) {
|
|
|
149
153
|
* non-React gate (e.g. a tracker's `isAnalyticsAllowed` option) doesn't have to reimplement
|
|
150
154
|
* "read storage, validate the policy version, fall back to `resolveDefaultConsent`" itself.
|
|
151
155
|
*
|
|
152
|
-
* @since
|
|
156
|
+
* @since 0.5.0-canary.6
|
|
153
157
|
*/
|
|
154
158
|
export function resolveEffectiveConsent(options) {
|
|
155
159
|
const { hasGlobalPrivacyControlSignal, mode, policyVersion, requestedCategories, storage } = options;
|
|
156
160
|
return (readStoredDecision(storage, policyVersion) ??
|
|
157
161
|
resolveDefaultConsent({ hasGlobalPrivacyControlSignal, mode, requestedCategories }));
|
|
158
|
-
}
|
|
159
|
-
//# sourceMappingURL=consent.js.map
|
|
162
|
+
}
|
package/dist/core/cookie.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Default lifetime shared by the anonymous-id and consent cookies — one year.
|
|
3
3
|
*
|
|
4
|
-
* @since
|
|
4
|
+
* @since 0.5.0-canary.6
|
|
5
5
|
*/
|
|
6
6
|
export declare const ONE_YEAR_IN_SECONDS: number;
|
|
7
7
|
/**
|
|
@@ -9,7 +9,6 @@ export declare const ONE_YEAR_IN_SECONDS: number;
|
|
|
9
9
|
* `document.cookie`, which share the `name=value; name2=value2` wire format — or
|
|
10
10
|
* `undefined` when absent. The name must match exactly; a longer prefix sibling is ignored.
|
|
11
11
|
*
|
|
12
|
-
* @since
|
|
12
|
+
* @since 0.5.0-canary.6
|
|
13
13
|
*/
|
|
14
|
-
export declare function readCookieValue(cookieString: string | null | undefined, cookieName: string): string | undefined;
|
|
15
|
-
//# sourceMappingURL=cookie.d.ts.map
|
|
14
|
+
export declare function readCookieValue(cookieString: string | null | undefined, cookieName: string): string | undefined;
|
package/dist/core/cookie.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Default lifetime shared by the anonymous-id and consent cookies — one year.
|
|
3
3
|
*
|
|
4
|
-
* @since
|
|
4
|
+
* @since 0.5.0-canary.6
|
|
5
5
|
*/
|
|
6
6
|
export const ONE_YEAR_IN_SECONDS = 60 * 60 * 24 * 365;
|
|
7
7
|
/**
|
|
@@ -9,7 +9,7 @@ export const ONE_YEAR_IN_SECONDS = 60 * 60 * 24 * 365;
|
|
|
9
9
|
* `document.cookie`, which share the `name=value; name2=value2` wire format — or
|
|
10
10
|
* `undefined` when absent. The name must match exactly; a longer prefix sibling is ignored.
|
|
11
11
|
*
|
|
12
|
-
* @since
|
|
12
|
+
* @since 0.5.0-canary.6
|
|
13
13
|
*/
|
|
14
14
|
export function readCookieValue(cookieString, cookieName) {
|
|
15
15
|
if (!cookieString) {
|
|
@@ -22,5 +22,4 @@ export function readCookieValue(cookieString, cookieName) {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
return undefined;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=cookie.js.map
|
|
25
|
+
}
|
|
@@ -25,5 +25,4 @@ export interface Destination {
|
|
|
25
25
|
onErasure?: ((id: string) => Promise<void> | void) | undefined;
|
|
26
26
|
/** Must always return a `Promise` — mark `send` `async` even if the body has no `await`. */
|
|
27
27
|
send: (event: TrackedEvent) => Promise<void>;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=destination.d.ts.map
|
|
28
|
+
}
|
package/dist/core/destination.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=destination.js.map
|
|
1
|
+
export {};
|
|
@@ -29,7 +29,6 @@ export declare function defineEventCatalog<Catalog extends EventCatalog>(catalog
|
|
|
29
29
|
* @throws Error when validation reports issues, or when the schema validates asynchronously —
|
|
30
30
|
* tracking sits on synchronous call paths, so async schemas are unsupported by design.
|
|
31
31
|
*
|
|
32
|
-
* @since
|
|
32
|
+
* @since 0.5.0-canary.6
|
|
33
33
|
*/
|
|
34
|
-
export declare function assertValidEventProperties(schema: StandardSchemaV1, eventName: string, properties: unknown): unknown;
|
|
35
|
-
//# sourceMappingURL=event-catalog.d.ts.map
|
|
34
|
+
export declare function assertValidEventProperties(schema: StandardSchemaV1, eventName: string, properties: unknown): unknown;
|
|
@@ -14,7 +14,7 @@ export function defineEventCatalog(catalog) {
|
|
|
14
14
|
* @throws Error when validation reports issues, or when the schema validates asynchronously —
|
|
15
15
|
* tracking sits on synchronous call paths, so async schemas are unsupported by design.
|
|
16
16
|
*
|
|
17
|
-
* @since
|
|
17
|
+
* @since 0.5.0-canary.6
|
|
18
18
|
*/
|
|
19
19
|
export function assertValidEventProperties(schema, eventName, properties) {
|
|
20
20
|
const result = schema["~standard"].validate(properties);
|
|
@@ -26,5 +26,4 @@ export function assertValidEventProperties(schema, eventName, properties) {
|
|
|
26
26
|
throw new Error(`Invalid properties for event "${eventName}": ${detail}`);
|
|
27
27
|
}
|
|
28
28
|
return result.value;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=event-catalog.js.map
|
|
29
|
+
}
|
package/dist/core/event-id.d.ts
CHANGED
package/dist/core/event-id.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=tracked-event.js.map
|
|
1
|
+
export {};
|
|
@@ -6,7 +6,7 @@ import type { ConsentDecision } from "#/core/consent";
|
|
|
6
6
|
* restricts to LDU but MUST NOT withhold first-party `analytics` (spec-consent §3). Every
|
|
7
7
|
* ad destination consumes this same shape so per-vendor mappings cannot drift.
|
|
8
8
|
*
|
|
9
|
-
* @since
|
|
9
|
+
* @since 0.5.0-canary.6
|
|
10
10
|
*/
|
|
11
11
|
export interface AdConsentState {
|
|
12
12
|
/** `ads` denied → the platform must restrict to Limited Data Use (Meta/TikTok LDU, UET `ad_storage` denied). */
|
|
@@ -17,7 +17,6 @@ export interface AdConsentState {
|
|
|
17
17
|
/**
|
|
18
18
|
* Normalizes a package `ConsentDecision` to the vendor-agnostic {@link AdConsentState}.
|
|
19
19
|
*
|
|
20
|
-
* @since
|
|
20
|
+
* @since 0.5.0-canary.6
|
|
21
21
|
*/
|
|
22
|
-
export declare function toAdConsentState(decision: ConsentDecision): AdConsentState;
|
|
23
|
-
//# sourceMappingURL=ad-consent.d.ts.map
|
|
22
|
+
export declare function toAdConsentState(decision: ConsentDecision): AdConsentState;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Normalizes a package `ConsentDecision` to the vendor-agnostic {@link AdConsentState}.
|
|
3
3
|
*
|
|
4
|
-
* @since
|
|
4
|
+
* @since 0.5.0-canary.6
|
|
5
5
|
*/
|
|
6
6
|
export function toAdConsentState(decision) {
|
|
7
7
|
return {
|
|
8
8
|
limitedDataUse: !decision.ads,
|
|
9
9
|
transmissionAllowed: decision.analytics,
|
|
10
10
|
};
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=ad-consent.js.map
|
|
11
|
+
}
|
|
@@ -9,7 +9,7 @@ type GtagPropertyValue = FlatPropertyValue;
|
|
|
9
9
|
* two separate `declare global` augmentations with different signatures for the same
|
|
10
10
|
* property is a TS error, not a merge.
|
|
11
11
|
*
|
|
12
|
-
* @since
|
|
12
|
+
* @since 0.5.0-canary.6
|
|
13
13
|
*/
|
|
14
14
|
export type GtagFunction = {
|
|
15
15
|
(command: "config", targetId: string, params?: Record<string, GtagPropertyValue>): void;
|
|
@@ -26,7 +26,9 @@ declare global {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Options for `ensureGtag`.
|
|
30
|
+
*
|
|
31
|
+
* @since 0.5.0-canary.6
|
|
30
32
|
*/
|
|
31
33
|
export interface EnsureGtagOptions {
|
|
32
34
|
/**
|
|
@@ -39,11 +41,13 @@ export interface EnsureGtagOptions {
|
|
|
39
41
|
* Ensures the standard gtag.js queueing stub exists so consent commands can be issued
|
|
40
42
|
* before the tag itself loads — gtag.js replays the queue in order once it boots.
|
|
41
43
|
*
|
|
42
|
-
* @since
|
|
44
|
+
* @since 0.5.0-canary.6
|
|
43
45
|
*/
|
|
44
46
|
export declare function ensureGtag(options?: EnsureGtagOptions): GtagFunction | undefined;
|
|
45
47
|
/**
|
|
46
|
-
*
|
|
48
|
+
* Options for `loadGtagScript`.
|
|
49
|
+
*
|
|
50
|
+
* @since 0.5.0-canary.6
|
|
47
51
|
*/
|
|
48
52
|
export interface LoadGtagScriptOptions {
|
|
49
53
|
/**
|
|
@@ -69,7 +73,7 @@ export interface LoadGtagScriptOptions {
|
|
|
69
73
|
* (advanced Consent Mode always injects the tag after the default); use this when the
|
|
70
74
|
* bootstrap did not run, or as an idempotent safety net after a runtime grant.
|
|
71
75
|
*
|
|
72
|
-
* @since
|
|
76
|
+
* @since 0.5.0-canary.6
|
|
73
77
|
*/
|
|
74
78
|
export declare function loadGtagScript(options: LoadGtagScriptOptions): void;
|
|
75
79
|
/**
|
|
@@ -77,7 +81,7 @@ export declare function loadGtagScript(options: LoadGtagScriptOptions): void;
|
|
|
77
81
|
* domain. Consent Mode stops using them once denied but never removes them — call from
|
|
78
82
|
* a consent-withdrawal handler so a revoke does not leave identifier cookies behind.
|
|
79
83
|
*
|
|
80
|
-
* @since
|
|
84
|
+
* @since 0.5.0-canary.6
|
|
81
85
|
*/
|
|
82
86
|
export declare function clearGoogleAnalyticsCookies(): void;
|
|
83
87
|
/**
|
|
@@ -89,7 +93,9 @@ export declare function clearGoogleAnalyticsCookies(): void;
|
|
|
89
93
|
*/
|
|
90
94
|
export declare function updateGoogleConsent(decision: ConsentDecision, options?: EnsureGtagOptions): void;
|
|
91
95
|
/**
|
|
92
|
-
*
|
|
96
|
+
* Options for `buildGtagConsentBootstrapScript`.
|
|
97
|
+
*
|
|
98
|
+
* @since 0.5.0-canary.6
|
|
93
99
|
*/
|
|
94
100
|
export interface GtagConsentBootstrapOptions {
|
|
95
101
|
/** The same object `useConsent` receives — the bootstrap reads its `storageKey` and `policyVersion`. */
|
|
@@ -125,10 +131,12 @@ export interface GtagConsentBootstrapOptions {
|
|
|
125
131
|
* so the already-loaded tag picks up the grant/deny — this only covers the page-load
|
|
126
132
|
* default + script injection.
|
|
127
133
|
*
|
|
128
|
-
* @since
|
|
134
|
+
* @since 0.5.0-canary.6
|
|
129
135
|
*/
|
|
130
136
|
export declare function buildGtagConsentBootstrapScript(options: GtagConsentBootstrapOptions): string;
|
|
131
137
|
/**
|
|
138
|
+
* Options for `createGoogleAnalyticsDestination`.
|
|
139
|
+
*
|
|
132
140
|
* @since 0.5.0-canary.4
|
|
133
141
|
*/
|
|
134
142
|
export interface GoogleAnalyticsDestinationOptions {
|
|
@@ -144,5 +152,4 @@ export interface GoogleAnalyticsDestinationOptions {
|
|
|
144
152
|
* @since 0.5.0-canary.4
|
|
145
153
|
*/
|
|
146
154
|
export declare function createGoogleAnalyticsDestination(options?: GoogleAnalyticsDestinationOptions): Destination;
|
|
147
|
-
export {};
|
|
148
|
-
//# sourceMappingURL=google-analytics.d.ts.map
|
|
155
|
+
export {};
|
|
@@ -14,7 +14,7 @@ function gtagScriptSrc(gaMeasurementId, dataLayerName) {
|
|
|
14
14
|
* Ensures the standard gtag.js queueing stub exists so consent commands can be issued
|
|
15
15
|
* before the tag itself loads — gtag.js replays the queue in order once it boots.
|
|
16
16
|
*
|
|
17
|
-
* @since
|
|
17
|
+
* @since 0.5.0-canary.6
|
|
18
18
|
*/
|
|
19
19
|
export function ensureGtag(options = {}) {
|
|
20
20
|
if (typeof window === "undefined") {
|
|
@@ -37,7 +37,7 @@ export function ensureGtag(options = {}) {
|
|
|
37
37
|
* (advanced Consent Mode always injects the tag after the default); use this when the
|
|
38
38
|
* bootstrap did not run, or as an idempotent safety net after a runtime grant.
|
|
39
39
|
*
|
|
40
|
-
* @since
|
|
40
|
+
* @since 0.5.0-canary.6
|
|
41
41
|
*/
|
|
42
42
|
export function loadGtagScript(options) {
|
|
43
43
|
if (typeof document === "undefined" || document.querySelector(`script[src^="${GTAG_SCRIPT_BASE_URL}"]`) !== null) {
|
|
@@ -68,7 +68,7 @@ export function loadGtagScript(options) {
|
|
|
68
68
|
* domain. Consent Mode stops using them once denied but never removes them — call from
|
|
69
69
|
* a consent-withdrawal handler so a revoke does not leave identifier cookies behind.
|
|
70
70
|
*
|
|
71
|
-
* @since
|
|
71
|
+
* @since 0.5.0-canary.6
|
|
72
72
|
*/
|
|
73
73
|
export function clearGoogleAnalyticsCookies() {
|
|
74
74
|
if (typeof document === "undefined") {
|
|
@@ -103,7 +103,7 @@ export function updateGoogleConsent(decision, options = {}) {
|
|
|
103
103
|
* so the already-loaded tag picks up the grant/deny — this only covers the page-load
|
|
104
104
|
* default + script injection.
|
|
105
105
|
*
|
|
106
|
-
* @since
|
|
106
|
+
* @since 0.5.0-canary.6
|
|
107
107
|
*/
|
|
108
108
|
export function buildGtagConsentBootstrapScript(options) {
|
|
109
109
|
const { config, dataLayerName = DEFAULT_DATA_LAYER_NAME, defaultConsent, debugMode, gaMeasurementId, nonce, } = options;
|
|
@@ -152,5 +152,4 @@ export function createGoogleAnalyticsDestination(options = {}) {
|
|
|
152
152
|
window.gtag("event", event.name, flattenEventProps(event.properties));
|
|
153
153
|
},
|
|
154
154
|
};
|
|
155
|
-
}
|
|
156
|
-
//# sourceMappingURL=google-analytics.js.map
|
|
155
|
+
}
|
|
@@ -2,7 +2,7 @@ import type { ConsentDecision } from "#/core/consent";
|
|
|
2
2
|
/**
|
|
3
3
|
* gtag.js/gtm.js's default queue-array name — shared so the gtag and GTM helpers cannot disagree.
|
|
4
4
|
*
|
|
5
|
-
* @since
|
|
5
|
+
* @since 0.5.0-canary.6
|
|
6
6
|
*/
|
|
7
7
|
export declare const DEFAULT_DATA_LAYER_NAME = "dataLayer";
|
|
8
8
|
type GoogleConsentState = "denied" | "granted";
|
|
@@ -10,7 +10,7 @@ type GoogleConsentState = "denied" | "granted";
|
|
|
10
10
|
* Consent Mode v2 params issued via `gtag('consent', …)` — shared by the gtag and GTM
|
|
11
11
|
* bootstraps so signal mapping cannot drift between them.
|
|
12
12
|
*
|
|
13
|
-
* @since
|
|
13
|
+
* @since 0.5.0-canary.6
|
|
14
14
|
*/
|
|
15
15
|
export interface GoogleConsentParams {
|
|
16
16
|
ad_personalization: GoogleConsentState;
|
|
@@ -23,11 +23,13 @@ export interface GoogleConsentParams {
|
|
|
23
23
|
/**
|
|
24
24
|
* Maps a package `ConsentDecision` onto Consent Mode v2's four storage signals.
|
|
25
25
|
*
|
|
26
|
-
* @since
|
|
26
|
+
* @since 0.5.0-canary.6
|
|
27
27
|
*/
|
|
28
28
|
export declare function toGoogleConsentParams(decision: ConsentDecision): GoogleConsentParams;
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* Options for `buildGoogleConsentBootstrapPreamble`.
|
|
31
|
+
*
|
|
32
|
+
* @since 0.5.0-canary.6
|
|
31
33
|
*/
|
|
32
34
|
export interface GoogleConsentBootstrapPreambleOptions {
|
|
33
35
|
/** localStorage key holding the package's `ConsentRecord`. */
|
|
@@ -43,20 +45,19 @@ export interface GoogleConsentBootstrapPreambleOptions {
|
|
|
43
45
|
* "default" signal. The builders append only their tag-specific tail, so the consent
|
|
44
46
|
* logic cannot drift between them.
|
|
45
47
|
*
|
|
46
|
-
* @since
|
|
48
|
+
* @since 0.5.0-canary.6
|
|
47
49
|
*/
|
|
48
50
|
export declare function buildGoogleConsentBootstrapPreamble(options: GoogleConsentBootstrapPreambleOptions): string;
|
|
49
51
|
/**
|
|
50
52
|
* Reads or creates a named `window[dataLayerName]` queue array.
|
|
51
53
|
*
|
|
52
|
-
* @since
|
|
54
|
+
* @since 0.5.0-canary.6
|
|
53
55
|
*/
|
|
54
56
|
export declare function ensureDataLayer(dataLayerName: string): Array<unknown> | undefined;
|
|
55
57
|
/**
|
|
56
58
|
* Warns and returns `false` when `eventName` would be rejected by GA4.
|
|
57
59
|
*
|
|
58
|
-
* @since
|
|
60
|
+
* @since 0.5.0-canary.6
|
|
59
61
|
*/
|
|
60
62
|
export declare function warnUnlessGa4EventName(destinationName: string, eventName: string): boolean;
|
|
61
|
-
export {};
|
|
62
|
-
//# sourceMappingURL=google-consent.d.ts.map
|
|
63
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import { CONSENT_CATEGORIES } from "#/core/consent";
|
|
|
2
2
|
/**
|
|
3
3
|
* gtag.js/gtm.js's default queue-array name — shared so the gtag and GTM helpers cannot disagree.
|
|
4
4
|
*
|
|
5
|
-
* @since
|
|
5
|
+
* @since 0.5.0-canary.6
|
|
6
6
|
*/
|
|
7
7
|
export const DEFAULT_DATA_LAYER_NAME = "dataLayer";
|
|
8
8
|
/**
|
|
@@ -18,7 +18,7 @@ const GOOGLE_CONSENT_SIGNAL_CATEGORIES = {
|
|
|
18
18
|
/**
|
|
19
19
|
* Maps a package `ConsentDecision` onto Consent Mode v2's four storage signals.
|
|
20
20
|
*
|
|
21
|
-
* @since
|
|
21
|
+
* @since 0.5.0-canary.6
|
|
22
22
|
*/
|
|
23
23
|
export function toGoogleConsentParams(decision) {
|
|
24
24
|
// Derived from the signal map (not hand-written per signal) so the runtime params and
|
|
@@ -52,7 +52,7 @@ function consentSignalAssignmentsExpression() {
|
|
|
52
52
|
* "default" signal. The builders append only their tag-specific tail, so the consent
|
|
53
53
|
* logic cannot drift between them.
|
|
54
54
|
*
|
|
55
|
-
* @since
|
|
55
|
+
* @since 0.5.0-canary.6
|
|
56
56
|
*/
|
|
57
57
|
export function buildGoogleConsentBootstrapPreamble(options) {
|
|
58
58
|
const dataLayerAccess = `window[${JSON.stringify(options.dataLayerName)}]`;
|
|
@@ -74,7 +74,7 @@ export function buildGoogleConsentBootstrapPreamble(options) {
|
|
|
74
74
|
/**
|
|
75
75
|
* Reads or creates a named `window[dataLayerName]` queue array.
|
|
76
76
|
*
|
|
77
|
-
* @since
|
|
77
|
+
* @since 0.5.0-canary.6
|
|
78
78
|
*/
|
|
79
79
|
export function ensureDataLayer(dataLayerName) {
|
|
80
80
|
if (typeof window === "undefined") {
|
|
@@ -97,7 +97,7 @@ function isGa4EventName(name) {
|
|
|
97
97
|
/**
|
|
98
98
|
* Warns and returns `false` when `eventName` would be rejected by GA4.
|
|
99
99
|
*
|
|
100
|
-
* @since
|
|
100
|
+
* @since 0.5.0-canary.6
|
|
101
101
|
*/
|
|
102
102
|
export function warnUnlessGa4EventName(destinationName, eventName) {
|
|
103
103
|
if (isGa4EventName(eventName)) {
|
|
@@ -105,5 +105,4 @@ export function warnUnlessGa4EventName(destinationName, eventName) {
|
|
|
105
105
|
}
|
|
106
106
|
console.warn(`[tracking] "${destinationName}" dropped event "${eventName}" — GA4 event names must start with a letter and contain only letters, digits, or underscores (max 40 chars)`);
|
|
107
107
|
return false;
|
|
108
|
-
}
|
|
109
|
-
//# sourceMappingURL=google-consent.js.map
|
|
108
|
+
}
|
|
@@ -7,7 +7,7 @@ import type { FlatPropertyValue } from "#/destinations/shared";
|
|
|
7
7
|
* country `1` (USA) / state `1000` (California) are documented codes (spec-destinations §5).
|
|
8
8
|
* `[]` applies no restriction.
|
|
9
9
|
*
|
|
10
|
-
* @since
|
|
10
|
+
* @since 0.5.0-canary.6
|
|
11
11
|
*/
|
|
12
12
|
export interface MetaDataProcessingOptions {
|
|
13
13
|
country: number;
|
|
@@ -17,13 +17,13 @@ export interface MetaDataProcessingOptions {
|
|
|
17
17
|
/**
|
|
18
18
|
* Maps a `ConsentDecision` to Meta's `dataProcessingOptions`: LDU when `ads` is denied.
|
|
19
19
|
*
|
|
20
|
-
* @since
|
|
20
|
+
* @since 0.5.0-canary.6
|
|
21
21
|
*/
|
|
22
22
|
export declare function toMetaDataProcessingOptions(decision: ConsentDecision): MetaDataProcessingOptions;
|
|
23
23
|
/**
|
|
24
24
|
* The mapped per-event payload handed to a Meta transport (Pixel `fbq` or a CAPI request).
|
|
25
25
|
*
|
|
26
|
-
* @since
|
|
26
|
+
* @since 0.5.0-canary.6
|
|
27
27
|
*/
|
|
28
28
|
export interface MetaEventPayload {
|
|
29
29
|
dataProcessingOptions: MetaDataProcessingOptions;
|
|
@@ -31,7 +31,9 @@ export interface MetaEventPayload {
|
|
|
31
31
|
properties: Record<string, FlatPropertyValue>;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* Options for `createMetaDestination`.
|
|
35
|
+
*
|
|
36
|
+
* @since 0.5.0-canary.6
|
|
35
37
|
*/
|
|
36
38
|
export interface MetaDestinationOptions {
|
|
37
39
|
/**
|
|
@@ -57,7 +59,6 @@ export interface MetaDestinationOptions {
|
|
|
57
59
|
* are the integrator's to supply. `consentRequirement` stays `"required"`: an ad sink is
|
|
58
60
|
* never exempt.
|
|
59
61
|
*
|
|
60
|
-
* @since
|
|
62
|
+
* @since 0.5.0-canary.6
|
|
61
63
|
*/
|
|
62
|
-
export declare function createMetaDestination(options: MetaDestinationOptions): Destination;
|
|
63
|
-
//# sourceMappingURL=meta.d.ts.map
|
|
64
|
+
export declare function createMetaDestination(options: MetaDestinationOptions): Destination;
|
|
@@ -3,7 +3,7 @@ import { flattenEventProps } from "#/destinations/shared";
|
|
|
3
3
|
/**
|
|
4
4
|
* Maps a `ConsentDecision` to Meta's `dataProcessingOptions`: LDU when `ads` is denied.
|
|
5
5
|
*
|
|
6
|
-
* @since
|
|
6
|
+
* @since 0.5.0-canary.6
|
|
7
7
|
*/
|
|
8
8
|
export function toMetaDataProcessingOptions(decision) {
|
|
9
9
|
return toAdConsentState(decision).limitedDataUse
|
|
@@ -17,7 +17,7 @@ export function toMetaDataProcessingOptions(decision) {
|
|
|
17
17
|
* are the integrator's to supply. `consentRequirement` stays `"required"`: an ad sink is
|
|
18
18
|
* never exempt.
|
|
19
19
|
*
|
|
20
|
-
* @since
|
|
20
|
+
* @since 0.5.0-canary.6
|
|
21
21
|
*/
|
|
22
22
|
export function createMetaDestination(options) {
|
|
23
23
|
// Erasure halts delivery for the rest of the session — Meta has no per-visitor deletion API.
|
|
@@ -40,5 +40,4 @@ export function createMetaDestination(options) {
|
|
|
40
40
|
});
|
|
41
41
|
},
|
|
42
42
|
};
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=meta.js.map
|
|
43
|
+
}
|
|
@@ -7,7 +7,7 @@ import type { FlatPropertyValue } from "#/destinations/shared";
|
|
|
7
7
|
* models the one enforced signal (spec-destinations §5). Pushed via
|
|
8
8
|
* `uetq.push('consent','update', …)`.
|
|
9
9
|
*
|
|
10
|
-
* @since
|
|
10
|
+
* @since 0.5.0-canary.6
|
|
11
11
|
*/
|
|
12
12
|
export interface MicrosoftUetConsent {
|
|
13
13
|
ad_storage: "denied" | "granted";
|
|
@@ -16,13 +16,13 @@ export interface MicrosoftUetConsent {
|
|
|
16
16
|
* Maps a `ConsentDecision` to UET's enforced `ad_storage` signal via the shared ad lever, so
|
|
17
17
|
* it can't drift from Meta/TikTok — `ad_storage` is the inverse of Limited Data Use.
|
|
18
18
|
*
|
|
19
|
-
* @since
|
|
19
|
+
* @since 0.5.0-canary.6
|
|
20
20
|
*/
|
|
21
21
|
export declare function toMicrosoftUetConsent(decision: ConsentDecision): MicrosoftUetConsent;
|
|
22
22
|
/**
|
|
23
23
|
* The mapped per-event payload handed to a UET transport (`uetq.push`).
|
|
24
24
|
*
|
|
25
|
-
* @since
|
|
25
|
+
* @since 0.5.0-canary.6
|
|
26
26
|
*/
|
|
27
27
|
export interface MicrosoftUetEventPayload {
|
|
28
28
|
consent: MicrosoftUetConsent;
|
|
@@ -30,7 +30,9 @@ export interface MicrosoftUetEventPayload {
|
|
|
30
30
|
properties: Record<string, FlatPropertyValue>;
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* Options for `createMicrosoftUetDestination`.
|
|
34
|
+
*
|
|
35
|
+
* @since 0.5.0-canary.6
|
|
34
36
|
*/
|
|
35
37
|
export interface MicrosoftUetDestinationOptions {
|
|
36
38
|
/** Erasure cookie-clear seam — UET exposes no per-visitor deletion API, so erasure is cookie-clear + stop-send (DSR-V4). */
|
|
@@ -50,7 +52,6 @@ export interface MicrosoftUetDestinationOptions {
|
|
|
50
52
|
* mapping only — the tag id and `uetq` transport are the integrator's. `consentRequirement`
|
|
51
53
|
* stays `"required"`.
|
|
52
54
|
*
|
|
53
|
-
* @since
|
|
55
|
+
* @since 0.5.0-canary.6
|
|
54
56
|
*/
|
|
55
|
-
export declare function createMicrosoftUetDestination(options: MicrosoftUetDestinationOptions): Destination;
|
|
56
|
-
//# sourceMappingURL=microsoft-uet.d.ts.map
|
|
57
|
+
export declare function createMicrosoftUetDestination(options: MicrosoftUetDestinationOptions): Destination;
|
|
@@ -4,7 +4,7 @@ import { flattenEventProps } from "#/destinations/shared";
|
|
|
4
4
|
* Maps a `ConsentDecision` to UET's enforced `ad_storage` signal via the shared ad lever, so
|
|
5
5
|
* it can't drift from Meta/TikTok — `ad_storage` is the inverse of Limited Data Use.
|
|
6
6
|
*
|
|
7
|
-
* @since
|
|
7
|
+
* @since 0.5.0-canary.6
|
|
8
8
|
*/
|
|
9
9
|
export function toMicrosoftUetConsent(decision) {
|
|
10
10
|
return { ad_storage: toAdConsentState(decision).limitedDataUse ? "denied" : "granted" };
|
|
@@ -15,7 +15,7 @@ export function toMicrosoftUetConsent(decision) {
|
|
|
15
15
|
* mapping only — the tag id and `uetq` transport are the integrator's. `consentRequirement`
|
|
16
16
|
* stays `"required"`.
|
|
17
17
|
*
|
|
18
|
-
* @since
|
|
18
|
+
* @since 0.5.0-canary.6
|
|
19
19
|
*/
|
|
20
20
|
export function createMicrosoftUetDestination(options) {
|
|
21
21
|
let stopped = false;
|
|
@@ -37,5 +37,4 @@ export function createMicrosoftUetDestination(options) {
|
|
|
37
37
|
});
|
|
38
38
|
},
|
|
39
39
|
};
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=microsoft-uet.js.map
|
|
40
|
+
}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* A primitive value every destination accepts as an event parameter.
|
|
3
|
+
*
|
|
4
|
+
* @since 0.5.0-canary.6
|
|
3
5
|
*/
|
|
4
6
|
export type FlatPropertyValue = boolean | number | string;
|
|
5
7
|
/**
|
|
6
8
|
* Event params must be flat string/number/boolean (optionally `null`) — stringify
|
|
7
9
|
* anything else instead of letting the destination silently drop it.
|
|
8
10
|
*
|
|
9
|
-
* @since
|
|
11
|
+
* @since 0.5.0-canary.6
|
|
10
12
|
*/
|
|
11
13
|
export declare function flattenEventProps(properties: Record<string, unknown>): Record<string, FlatPropertyValue>;
|
|
12
14
|
/**
|
|
13
|
-
*
|
|
15
|
+
* Flattens event properties while also passing `null` through for destinations that accept it.
|
|
16
|
+
*
|
|
17
|
+
* @since 0.5.0-canary.6
|
|
14
18
|
*/
|
|
15
19
|
export declare function flattenEventProps(properties: Record<string, unknown>, options: {
|
|
16
20
|
allowNull: true;
|
|
17
|
-
}): Record<string, FlatPropertyValue | null>;
|
|
18
|
-
//# sourceMappingURL=shared.d.ts.map
|
|
21
|
+
}): Record<string, FlatPropertyValue | null>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Shared implementation backing both overloads.
|
|
3
|
+
*
|
|
4
|
+
* @since 0.5.0-canary.6
|
|
3
5
|
*/
|
|
4
6
|
export function flattenEventProps(properties, options = {}) {
|
|
5
7
|
const result = {};
|
|
@@ -15,5 +17,4 @@ export function flattenEventProps(properties, options = {}) {
|
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
19
|
return result;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=shared.js.map
|
|
20
|
+
}
|