@aranova/tracking-next 0.5.0 → 0.6.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 +150 -0
- package/dist/index.d.mts +194 -112
- package/dist/index.d.ts +194 -112
- package/dist/index.js +183 -73
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +183 -73
- package/dist/index.mjs.map +1 -1
- package/dist/middleware.js +97 -66
- package/dist/middleware.js.map +1 -1
- package/dist/middleware.mjs +98 -67
- package/dist/middleware.mjs.map +1 -1
- package/dist/server.js +97 -66
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +98 -67
- package/dist/server.mjs.map +1 -1
- package/package.json +3 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { C as ConsentState, T as TrackingInstallSurface, a as TrackingClientContext, b as TrackingParams, c as TrackingEventCreatePayload, d as TrackingSessionUpsertPayload } from './types-Gp0ioRiQ.mjs';
|
|
2
2
|
export { e as TrackingInitConfig } from './types-Gp0ioRiQ.mjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
+
import * as src from 'src';
|
|
4
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
6
|
import { ReactNode } from 'react';
|
|
6
7
|
|
|
@@ -34,82 +35,11 @@ declare function createTrackingEventCreatePayload(trackingParams: TrackingParams
|
|
|
34
35
|
declare const TRACKING_PARAM_KEYS: readonly ["gclid", "fbclid", "utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content"];
|
|
35
36
|
declare function captureTrackingParamsFromLocation(url?: string, maxAgeSeconds?: number): TrackingParams;
|
|
36
37
|
|
|
37
|
-
interface TrackEventInput {
|
|
38
|
-
eventType: string;
|
|
39
|
-
pageUrl?: string | null;
|
|
40
|
-
metadata?: Record<string, unknown> | null;
|
|
41
|
-
occurredAt?: Date | string | null;
|
|
42
|
-
}
|
|
43
|
-
interface TrackingClient {
|
|
44
|
-
trackEvent: (input: TrackEventInput) => void;
|
|
45
|
-
flush: () => Promise<void>;
|
|
46
|
-
getSessionId: () => string;
|
|
47
|
-
getVisitorId: () => string;
|
|
48
|
-
destroy: () => void;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
declare const pageViewMetadataSchema: z.ZodObject<{
|
|
52
|
-
page: z.ZodObject<{
|
|
53
|
-
title: z.ZodNullable<z.ZodString>;
|
|
54
|
-
path: z.ZodString;
|
|
55
|
-
search: z.ZodString;
|
|
56
|
-
hash: z.ZodString;
|
|
57
|
-
}, "strip", z.ZodTypeAny, {
|
|
58
|
-
search: string;
|
|
59
|
-
title: string | null;
|
|
60
|
-
path: string;
|
|
61
|
-
hash: string;
|
|
62
|
-
}, {
|
|
63
|
-
search: string;
|
|
64
|
-
title: string | null;
|
|
65
|
-
path: string;
|
|
66
|
-
hash: string;
|
|
67
|
-
}>;
|
|
68
|
-
referrer: z.ZodNullable<z.ZodString>;
|
|
69
|
-
viewport: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
70
|
-
w: z.ZodNumber;
|
|
71
|
-
h: z.ZodNumber;
|
|
72
|
-
}, "strip", z.ZodTypeAny, {
|
|
73
|
-
w: number;
|
|
74
|
-
h: number;
|
|
75
|
-
}, {
|
|
76
|
-
w: number;
|
|
77
|
-
h: number;
|
|
78
|
-
}>>>;
|
|
79
|
-
}, "strict", z.ZodTypeAny, {
|
|
80
|
-
page: {
|
|
81
|
-
search: string;
|
|
82
|
-
title: string | null;
|
|
83
|
-
path: string;
|
|
84
|
-
hash: string;
|
|
85
|
-
};
|
|
86
|
-
referrer: string | null;
|
|
87
|
-
viewport?: {
|
|
88
|
-
w: number;
|
|
89
|
-
h: number;
|
|
90
|
-
} | null | undefined;
|
|
91
|
-
}, {
|
|
92
|
-
page: {
|
|
93
|
-
search: string;
|
|
94
|
-
title: string | null;
|
|
95
|
-
path: string;
|
|
96
|
-
hash: string;
|
|
97
|
-
};
|
|
98
|
-
referrer: string | null;
|
|
99
|
-
viewport?: {
|
|
100
|
-
w: number;
|
|
101
|
-
h: number;
|
|
102
|
-
} | null | undefined;
|
|
103
|
-
}>;
|
|
104
|
-
type PageViewMetadata = z.infer<typeof pageViewMetadataSchema>;
|
|
105
|
-
declare const pageViewConfigSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
|
|
106
|
-
type PageViewConfig = z.infer<typeof pageViewConfigSchema>;
|
|
107
|
-
|
|
108
38
|
declare const ctaClickMetadataSchema: z.ZodObject<{
|
|
109
39
|
cta_name: z.ZodString;
|
|
110
40
|
page: z.ZodObject<{
|
|
111
41
|
path: z.ZodString;
|
|
112
|
-
}, "
|
|
42
|
+
}, "strict", z.ZodTypeAny, {
|
|
113
43
|
path: string;
|
|
114
44
|
}, {
|
|
115
45
|
path: string;
|
|
@@ -135,11 +65,49 @@ type CtaClickMetadata = z.infer<typeof ctaClickMetadataSchema>;
|
|
|
135
65
|
declare const ctaClickConfigSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
|
|
136
66
|
type CtaClickConfig = z.infer<typeof ctaClickConfigSchema>;
|
|
137
67
|
|
|
68
|
+
declare const sdkHeartbeatMetadataSchema: z.ZodObject<{
|
|
69
|
+
sdk_version: z.ZodString;
|
|
70
|
+
package_name: z.ZodNullable<z.ZodString>;
|
|
71
|
+
surface: z.ZodEnum<["next", "react", "script"]>;
|
|
72
|
+
triggers: z.ZodObject<{
|
|
73
|
+
automatic: z.ZodArray<z.ZodString, "many">;
|
|
74
|
+
manual: z.ZodArray<z.ZodString, "many">;
|
|
75
|
+
}, "strict", z.ZodTypeAny, {
|
|
76
|
+
automatic: string[];
|
|
77
|
+
manual: string[];
|
|
78
|
+
}, {
|
|
79
|
+
automatic: string[];
|
|
80
|
+
manual: string[];
|
|
81
|
+
}>;
|
|
82
|
+
trigger_config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
83
|
+
}, "strict", z.ZodTypeAny, {
|
|
84
|
+
sdk_version: string;
|
|
85
|
+
package_name: string | null;
|
|
86
|
+
surface: "next" | "react" | "script";
|
|
87
|
+
triggers: {
|
|
88
|
+
automatic: string[];
|
|
89
|
+
manual: string[];
|
|
90
|
+
};
|
|
91
|
+
trigger_config?: Record<string, Record<string, unknown>> | null | undefined;
|
|
92
|
+
}, {
|
|
93
|
+
sdk_version: string;
|
|
94
|
+
package_name: string | null;
|
|
95
|
+
surface: "next" | "react" | "script";
|
|
96
|
+
triggers: {
|
|
97
|
+
automatic: string[];
|
|
98
|
+
manual: string[];
|
|
99
|
+
};
|
|
100
|
+
trigger_config?: Record<string, Record<string, unknown>> | null | undefined;
|
|
101
|
+
}>;
|
|
102
|
+
type SdkHeartbeatMetadata = z.infer<typeof sdkHeartbeatMetadataSchema>;
|
|
103
|
+
declare const sdkHeartbeatConfigSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
|
|
104
|
+
type SdkHeartbeatConfig = z.infer<typeof sdkHeartbeatConfigSchema>;
|
|
105
|
+
|
|
138
106
|
declare const formStartMetadataSchema: z.ZodObject<{
|
|
139
107
|
form: z.ZodObject<{
|
|
140
108
|
id: z.ZodString;
|
|
141
109
|
action: z.ZodNullable<z.ZodString>;
|
|
142
|
-
}, "
|
|
110
|
+
}, "strict", z.ZodTypeAny, {
|
|
143
111
|
id: string;
|
|
144
112
|
action: string | null;
|
|
145
113
|
}, {
|
|
@@ -148,7 +116,7 @@ declare const formStartMetadataSchema: z.ZodObject<{
|
|
|
148
116
|
}>;
|
|
149
117
|
page: z.ZodObject<{
|
|
150
118
|
path: z.ZodString;
|
|
151
|
-
}, "
|
|
119
|
+
}, "strict", z.ZodTypeAny, {
|
|
152
120
|
path: string;
|
|
153
121
|
}, {
|
|
154
122
|
path: string;
|
|
@@ -180,6 +148,9 @@ declare const formStartConfigSchema: z.ZodObject<{
|
|
|
180
148
|
}>;
|
|
181
149
|
type FormStartConfig = z.infer<typeof formStartConfigSchema>;
|
|
182
150
|
|
|
151
|
+
type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
152
|
+
[key: string]: JsonValue;
|
|
153
|
+
};
|
|
183
154
|
declare const formSubmitMetadataSchema: z.ZodObject<{
|
|
184
155
|
form: z.ZodObject<{
|
|
185
156
|
id: z.ZodString;
|
|
@@ -188,40 +159,40 @@ declare const formSubmitMetadataSchema: z.ZodObject<{
|
|
|
188
159
|
name: z.ZodString;
|
|
189
160
|
type: z.ZodString;
|
|
190
161
|
label: z.ZodNullable<z.ZodString>;
|
|
191
|
-
|
|
192
|
-
}, "
|
|
162
|
+
value: z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>;
|
|
163
|
+
}, "strict", z.ZodTypeAny, {
|
|
193
164
|
label: string | null;
|
|
165
|
+
value: JsonValue;
|
|
194
166
|
type: string;
|
|
195
167
|
name: string;
|
|
196
|
-
has_value: boolean;
|
|
197
168
|
}, {
|
|
198
169
|
label: string | null;
|
|
170
|
+
value: JsonValue;
|
|
199
171
|
type: string;
|
|
200
172
|
name: string;
|
|
201
|
-
has_value: boolean;
|
|
202
173
|
}>, "many">>;
|
|
203
|
-
}, "
|
|
174
|
+
}, "strict", z.ZodTypeAny, {
|
|
204
175
|
id: string;
|
|
205
176
|
action: string | null;
|
|
206
177
|
fields?: {
|
|
207
178
|
label: string | null;
|
|
179
|
+
value: JsonValue;
|
|
208
180
|
type: string;
|
|
209
181
|
name: string;
|
|
210
|
-
has_value: boolean;
|
|
211
182
|
}[] | undefined;
|
|
212
183
|
}, {
|
|
213
184
|
id: string;
|
|
214
185
|
action: string | null;
|
|
215
186
|
fields?: {
|
|
216
187
|
label: string | null;
|
|
188
|
+
value: JsonValue;
|
|
217
189
|
type: string;
|
|
218
190
|
name: string;
|
|
219
|
-
has_value: boolean;
|
|
220
191
|
}[] | undefined;
|
|
221
192
|
}>;
|
|
222
193
|
page: z.ZodObject<{
|
|
223
194
|
path: z.ZodString;
|
|
224
|
-
}, "
|
|
195
|
+
}, "strict", z.ZodTypeAny, {
|
|
225
196
|
path: string;
|
|
226
197
|
}, {
|
|
227
198
|
path: string;
|
|
@@ -232,9 +203,9 @@ declare const formSubmitMetadataSchema: z.ZodObject<{
|
|
|
232
203
|
action: string | null;
|
|
233
204
|
fields?: {
|
|
234
205
|
label: string | null;
|
|
206
|
+
value: JsonValue;
|
|
235
207
|
type: string;
|
|
236
208
|
name: string;
|
|
237
|
-
has_value: boolean;
|
|
238
209
|
}[] | undefined;
|
|
239
210
|
};
|
|
240
211
|
page: {
|
|
@@ -246,9 +217,9 @@ declare const formSubmitMetadataSchema: z.ZodObject<{
|
|
|
246
217
|
action: string | null;
|
|
247
218
|
fields?: {
|
|
248
219
|
label: string | null;
|
|
220
|
+
value: JsonValue;
|
|
249
221
|
type: string;
|
|
250
222
|
name: string;
|
|
251
|
-
has_value: boolean;
|
|
252
223
|
}[] | undefined;
|
|
253
224
|
};
|
|
254
225
|
page: {
|
|
@@ -263,7 +234,7 @@ declare const multiPageSessionMetadataSchema: z.ZodObject<{
|
|
|
263
234
|
page_count: z.ZodNumber;
|
|
264
235
|
page: z.ZodObject<{
|
|
265
236
|
path: z.ZodString;
|
|
266
|
-
}, "
|
|
237
|
+
}, "strict", z.ZodTypeAny, {
|
|
267
238
|
path: string;
|
|
268
239
|
}, {
|
|
269
240
|
path: string;
|
|
@@ -289,11 +260,68 @@ declare const multiPageSessionConfigSchema: z.ZodObject<{
|
|
|
289
260
|
}>;
|
|
290
261
|
type MultiPageSessionConfig = z.infer<typeof multiPageSessionConfigSchema>;
|
|
291
262
|
|
|
263
|
+
declare const pageViewMetadataSchema: z.ZodObject<{
|
|
264
|
+
page: z.ZodObject<{
|
|
265
|
+
title: z.ZodNullable<z.ZodString>;
|
|
266
|
+
path: z.ZodString;
|
|
267
|
+
search: z.ZodString;
|
|
268
|
+
hash: z.ZodString;
|
|
269
|
+
}, "strict", z.ZodTypeAny, {
|
|
270
|
+
search: string;
|
|
271
|
+
title: string | null;
|
|
272
|
+
path: string;
|
|
273
|
+
hash: string;
|
|
274
|
+
}, {
|
|
275
|
+
search: string;
|
|
276
|
+
title: string | null;
|
|
277
|
+
path: string;
|
|
278
|
+
hash: string;
|
|
279
|
+
}>;
|
|
280
|
+
referrer: z.ZodNullable<z.ZodString>;
|
|
281
|
+
viewport: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
282
|
+
w: z.ZodNumber;
|
|
283
|
+
h: z.ZodNumber;
|
|
284
|
+
}, "strict", z.ZodTypeAny, {
|
|
285
|
+
w: number;
|
|
286
|
+
h: number;
|
|
287
|
+
}, {
|
|
288
|
+
w: number;
|
|
289
|
+
h: number;
|
|
290
|
+
}>>>;
|
|
291
|
+
}, "strict", z.ZodTypeAny, {
|
|
292
|
+
page: {
|
|
293
|
+
search: string;
|
|
294
|
+
title: string | null;
|
|
295
|
+
path: string;
|
|
296
|
+
hash: string;
|
|
297
|
+
};
|
|
298
|
+
referrer: string | null;
|
|
299
|
+
viewport?: {
|
|
300
|
+
w: number;
|
|
301
|
+
h: number;
|
|
302
|
+
} | null | undefined;
|
|
303
|
+
}, {
|
|
304
|
+
page: {
|
|
305
|
+
search: string;
|
|
306
|
+
title: string | null;
|
|
307
|
+
path: string;
|
|
308
|
+
hash: string;
|
|
309
|
+
};
|
|
310
|
+
referrer: string | null;
|
|
311
|
+
viewport?: {
|
|
312
|
+
w: number;
|
|
313
|
+
h: number;
|
|
314
|
+
} | null | undefined;
|
|
315
|
+
}>;
|
|
316
|
+
type PageViewMetadata = z.infer<typeof pageViewMetadataSchema>;
|
|
317
|
+
declare const pageViewConfigSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
|
|
318
|
+
type PageViewConfig = z.infer<typeof pageViewConfigSchema>;
|
|
319
|
+
|
|
292
320
|
declare const phoneClickMetadataSchema: z.ZodObject<{
|
|
293
321
|
phone_number: z.ZodString;
|
|
294
322
|
page: z.ZodObject<{
|
|
295
323
|
path: z.ZodString;
|
|
296
|
-
}, "
|
|
324
|
+
}, "strict", z.ZodTypeAny, {
|
|
297
325
|
path: string;
|
|
298
326
|
}, {
|
|
299
327
|
path: string;
|
|
@@ -320,7 +348,7 @@ declare const scrollDepthMetadataSchema: z.ZodObject<{
|
|
|
320
348
|
depth_percent: z.ZodNumber;
|
|
321
349
|
page: z.ZodObject<{
|
|
322
350
|
path: z.ZodString;
|
|
323
|
-
}, "
|
|
351
|
+
}, "strict", z.ZodTypeAny, {
|
|
324
352
|
path: string;
|
|
325
353
|
}, {
|
|
326
354
|
path: string;
|
|
@@ -352,7 +380,7 @@ declare const specificPageVisitMetadataSchema: z.ZodObject<{
|
|
|
352
380
|
page_name: z.ZodEnum<["contact_page", "about_page", "services_page", "booking_page", "location_page", "pricing_page", "faq_page", "testimonials_page"]>;
|
|
353
381
|
page: z.ZodObject<{
|
|
354
382
|
path: z.ZodString;
|
|
355
|
-
}, "
|
|
383
|
+
}, "strict", z.ZodTypeAny, {
|
|
356
384
|
path: string;
|
|
357
385
|
}, {
|
|
358
386
|
path: string;
|
|
@@ -373,7 +401,7 @@ declare const specificPageVisitConfigSchema: z.ZodObject<{
|
|
|
373
401
|
pages: z.ZodArray<z.ZodObject<{
|
|
374
402
|
name: z.ZodEnum<["contact_page", "about_page", "services_page", "booking_page", "location_page", "pricing_page", "faq_page", "testimonials_page"]>;
|
|
375
403
|
pathPattern: z.ZodType<RegExp, z.ZodTypeDef, RegExp>;
|
|
376
|
-
}, "
|
|
404
|
+
}, "strict", z.ZodTypeAny, {
|
|
377
405
|
name: "contact_page" | "about_page" | "services_page" | "booking_page" | "location_page" | "pricing_page" | "faq_page" | "testimonials_page";
|
|
378
406
|
pathPattern: RegExp;
|
|
379
407
|
}, {
|
|
@@ -397,7 +425,7 @@ declare const timeOnSiteMetadataSchema: z.ZodObject<{
|
|
|
397
425
|
duration_ms: z.ZodNumber;
|
|
398
426
|
page: z.ZodObject<{
|
|
399
427
|
path: z.ZodString;
|
|
400
|
-
}, "
|
|
428
|
+
}, "strict", z.ZodTypeAny, {
|
|
401
429
|
path: string;
|
|
402
430
|
}, {
|
|
403
431
|
path: string;
|
|
@@ -432,7 +460,7 @@ declare const EVENT_REGISTRY: {
|
|
|
432
460
|
path: z.ZodString;
|
|
433
461
|
search: z.ZodString;
|
|
434
462
|
hash: z.ZodString;
|
|
435
|
-
}, "
|
|
463
|
+
}, "strict", z.ZodTypeAny, {
|
|
436
464
|
search: string;
|
|
437
465
|
title: string | null;
|
|
438
466
|
path: string;
|
|
@@ -447,7 +475,7 @@ declare const EVENT_REGISTRY: {
|
|
|
447
475
|
viewport: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
448
476
|
w: z.ZodNumber;
|
|
449
477
|
h: z.ZodNumber;
|
|
450
|
-
}, "
|
|
478
|
+
}, "strict", z.ZodTypeAny, {
|
|
451
479
|
w: number;
|
|
452
480
|
h: number;
|
|
453
481
|
}, {
|
|
@@ -487,7 +515,7 @@ declare const EVENT_REGISTRY: {
|
|
|
487
515
|
duration_ms: z.ZodNumber;
|
|
488
516
|
page: z.ZodObject<{
|
|
489
517
|
path: z.ZodString;
|
|
490
|
-
}, "
|
|
518
|
+
}, "strict", z.ZodTypeAny, {
|
|
491
519
|
path: string;
|
|
492
520
|
}, {
|
|
493
521
|
path: string;
|
|
@@ -517,7 +545,7 @@ declare const EVENT_REGISTRY: {
|
|
|
517
545
|
page_name: z.ZodEnum<["contact_page", "about_page", "services_page", "booking_page", "location_page", "pricing_page", "faq_page", "testimonials_page"]>;
|
|
518
546
|
page: z.ZodObject<{
|
|
519
547
|
path: z.ZodString;
|
|
520
|
-
}, "
|
|
548
|
+
}, "strict", z.ZodTypeAny, {
|
|
521
549
|
path: string;
|
|
522
550
|
}, {
|
|
523
551
|
path: string;
|
|
@@ -537,7 +565,7 @@ declare const EVENT_REGISTRY: {
|
|
|
537
565
|
pages: z.ZodArray<z.ZodObject<{
|
|
538
566
|
name: z.ZodEnum<["contact_page", "about_page", "services_page", "booking_page", "location_page", "pricing_page", "faq_page", "testimonials_page"]>;
|
|
539
567
|
pathPattern: z.ZodType<RegExp, z.ZodTypeDef, RegExp>;
|
|
540
|
-
}, "
|
|
568
|
+
}, "strict", z.ZodTypeAny, {
|
|
541
569
|
name: "contact_page" | "about_page" | "services_page" | "booking_page" | "location_page" | "pricing_page" | "faq_page" | "testimonials_page";
|
|
542
570
|
pathPattern: RegExp;
|
|
543
571
|
}, {
|
|
@@ -562,7 +590,7 @@ declare const EVENT_REGISTRY: {
|
|
|
562
590
|
depth_percent: z.ZodNumber;
|
|
563
591
|
page: z.ZodObject<{
|
|
564
592
|
path: z.ZodString;
|
|
565
|
-
}, "
|
|
593
|
+
}, "strict", z.ZodTypeAny, {
|
|
566
594
|
path: string;
|
|
567
595
|
}, {
|
|
568
596
|
path: string;
|
|
@@ -592,7 +620,7 @@ declare const EVENT_REGISTRY: {
|
|
|
592
620
|
page_count: z.ZodNumber;
|
|
593
621
|
page: z.ZodObject<{
|
|
594
622
|
path: z.ZodString;
|
|
595
|
-
}, "
|
|
623
|
+
}, "strict", z.ZodTypeAny, {
|
|
596
624
|
path: string;
|
|
597
625
|
}, {
|
|
598
626
|
path: string;
|
|
@@ -622,7 +650,7 @@ declare const EVENT_REGISTRY: {
|
|
|
622
650
|
form: z.ZodObject<{
|
|
623
651
|
id: z.ZodString;
|
|
624
652
|
action: z.ZodNullable<z.ZodString>;
|
|
625
|
-
}, "
|
|
653
|
+
}, "strict", z.ZodTypeAny, {
|
|
626
654
|
id: string;
|
|
627
655
|
action: string | null;
|
|
628
656
|
}, {
|
|
@@ -631,7 +659,7 @@ declare const EVENT_REGISTRY: {
|
|
|
631
659
|
}>;
|
|
632
660
|
page: z.ZodObject<{
|
|
633
661
|
path: z.ZodString;
|
|
634
|
-
}, "
|
|
662
|
+
}, "strict", z.ZodTypeAny, {
|
|
635
663
|
path: string;
|
|
636
664
|
}, {
|
|
637
665
|
path: string;
|
|
@@ -661,6 +689,44 @@ declare const EVENT_REGISTRY: {
|
|
|
661
689
|
selector?: string | undefined;
|
|
662
690
|
}>;
|
|
663
691
|
};
|
|
692
|
+
readonly sdk_heartbeat: {
|
|
693
|
+
readonly kind: "automatic";
|
|
694
|
+
readonly metadataSchema: z.ZodObject<{
|
|
695
|
+
sdk_version: z.ZodString;
|
|
696
|
+
package_name: z.ZodNullable<z.ZodString>;
|
|
697
|
+
surface: z.ZodEnum<["next", "react", "script"]>;
|
|
698
|
+
triggers: z.ZodObject<{
|
|
699
|
+
automatic: z.ZodArray<z.ZodString, "many">;
|
|
700
|
+
manual: z.ZodArray<z.ZodString, "many">;
|
|
701
|
+
}, "strict", z.ZodTypeAny, {
|
|
702
|
+
automatic: string[];
|
|
703
|
+
manual: string[];
|
|
704
|
+
}, {
|
|
705
|
+
automatic: string[];
|
|
706
|
+
manual: string[];
|
|
707
|
+
}>;
|
|
708
|
+
trigger_config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
709
|
+
}, "strict", z.ZodTypeAny, {
|
|
710
|
+
sdk_version: string;
|
|
711
|
+
package_name: string | null;
|
|
712
|
+
surface: "next" | "react" | "script";
|
|
713
|
+
triggers: {
|
|
714
|
+
automatic: string[];
|
|
715
|
+
manual: string[];
|
|
716
|
+
};
|
|
717
|
+
trigger_config?: Record<string, Record<string, unknown>> | null | undefined;
|
|
718
|
+
}, {
|
|
719
|
+
sdk_version: string;
|
|
720
|
+
package_name: string | null;
|
|
721
|
+
surface: "next" | "react" | "script";
|
|
722
|
+
triggers: {
|
|
723
|
+
automatic: string[];
|
|
724
|
+
manual: string[];
|
|
725
|
+
};
|
|
726
|
+
trigger_config?: Record<string, Record<string, unknown>> | null | undefined;
|
|
727
|
+
}>;
|
|
728
|
+
readonly configSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
|
|
729
|
+
};
|
|
664
730
|
readonly form_submit: {
|
|
665
731
|
readonly kind: "manual";
|
|
666
732
|
readonly metadataSchema: z.ZodObject<{
|
|
@@ -671,40 +737,40 @@ declare const EVENT_REGISTRY: {
|
|
|
671
737
|
name: z.ZodString;
|
|
672
738
|
type: z.ZodString;
|
|
673
739
|
label: z.ZodNullable<z.ZodString>;
|
|
674
|
-
|
|
675
|
-
}, "
|
|
740
|
+
value: z.ZodType<src.JsonValue, z.ZodTypeDef, src.JsonValue>;
|
|
741
|
+
}, "strict", z.ZodTypeAny, {
|
|
676
742
|
label: string | null;
|
|
743
|
+
value: src.JsonValue;
|
|
677
744
|
type: string;
|
|
678
745
|
name: string;
|
|
679
|
-
has_value: boolean;
|
|
680
746
|
}, {
|
|
681
747
|
label: string | null;
|
|
748
|
+
value: src.JsonValue;
|
|
682
749
|
type: string;
|
|
683
750
|
name: string;
|
|
684
|
-
has_value: boolean;
|
|
685
751
|
}>, "many">>;
|
|
686
|
-
}, "
|
|
752
|
+
}, "strict", z.ZodTypeAny, {
|
|
687
753
|
id: string;
|
|
688
754
|
action: string | null;
|
|
689
755
|
fields?: {
|
|
690
756
|
label: string | null;
|
|
757
|
+
value: src.JsonValue;
|
|
691
758
|
type: string;
|
|
692
759
|
name: string;
|
|
693
|
-
has_value: boolean;
|
|
694
760
|
}[] | undefined;
|
|
695
761
|
}, {
|
|
696
762
|
id: string;
|
|
697
763
|
action: string | null;
|
|
698
764
|
fields?: {
|
|
699
765
|
label: string | null;
|
|
766
|
+
value: src.JsonValue;
|
|
700
767
|
type: string;
|
|
701
768
|
name: string;
|
|
702
|
-
has_value: boolean;
|
|
703
769
|
}[] | undefined;
|
|
704
770
|
}>;
|
|
705
771
|
page: z.ZodObject<{
|
|
706
772
|
path: z.ZodString;
|
|
707
|
-
}, "
|
|
773
|
+
}, "strict", z.ZodTypeAny, {
|
|
708
774
|
path: string;
|
|
709
775
|
}, {
|
|
710
776
|
path: string;
|
|
@@ -715,9 +781,9 @@ declare const EVENT_REGISTRY: {
|
|
|
715
781
|
action: string | null;
|
|
716
782
|
fields?: {
|
|
717
783
|
label: string | null;
|
|
784
|
+
value: src.JsonValue;
|
|
718
785
|
type: string;
|
|
719
786
|
name: string;
|
|
720
|
-
has_value: boolean;
|
|
721
787
|
}[] | undefined;
|
|
722
788
|
};
|
|
723
789
|
page: {
|
|
@@ -729,9 +795,9 @@ declare const EVENT_REGISTRY: {
|
|
|
729
795
|
action: string | null;
|
|
730
796
|
fields?: {
|
|
731
797
|
label: string | null;
|
|
798
|
+
value: src.JsonValue;
|
|
732
799
|
type: string;
|
|
733
800
|
name: string;
|
|
734
|
-
has_value: boolean;
|
|
735
801
|
}[] | undefined;
|
|
736
802
|
};
|
|
737
803
|
page: {
|
|
@@ -746,7 +812,7 @@ declare const EVENT_REGISTRY: {
|
|
|
746
812
|
phone_number: z.ZodString;
|
|
747
813
|
page: z.ZodObject<{
|
|
748
814
|
path: z.ZodString;
|
|
749
|
-
}, "
|
|
815
|
+
}, "strict", z.ZodTypeAny, {
|
|
750
816
|
path: string;
|
|
751
817
|
}, {
|
|
752
818
|
path: string;
|
|
@@ -773,7 +839,7 @@ declare const EVENT_REGISTRY: {
|
|
|
773
839
|
cta_name: z.ZodString;
|
|
774
840
|
page: z.ZodObject<{
|
|
775
841
|
path: z.ZodString;
|
|
776
|
-
}, "
|
|
842
|
+
}, "strict", z.ZodTypeAny, {
|
|
777
843
|
path: string;
|
|
778
844
|
}, {
|
|
779
845
|
path: string;
|
|
@@ -812,6 +878,7 @@ type MetadataByName = {
|
|
|
812
878
|
scroll_depth: ScrollDepthMetadata;
|
|
813
879
|
multi_page_session: MultiPageSessionMetadata;
|
|
814
880
|
form_start: FormStartMetadata;
|
|
881
|
+
sdk_heartbeat: SdkHeartbeatMetadata;
|
|
815
882
|
form_submit: FormSubmitMetadata;
|
|
816
883
|
phone_click: PhoneClickMetadata;
|
|
817
884
|
cta_click: CtaClickMetadata;
|
|
@@ -823,6 +890,7 @@ type ConfigByName = {
|
|
|
823
890
|
scroll_depth: ScrollDepthConfig;
|
|
824
891
|
multi_page_session: MultiPageSessionConfig;
|
|
825
892
|
form_start: FormStartConfig;
|
|
893
|
+
sdk_heartbeat: SdkHeartbeatConfig;
|
|
826
894
|
form_submit: FormSubmitConfig;
|
|
827
895
|
phone_click: PhoneClickConfig;
|
|
828
896
|
cta_click: CtaClickConfig;
|
|
@@ -848,6 +916,20 @@ type TriggerRegistryConfig = {
|
|
|
848
916
|
type RegisteredManualEvents<TRegistry extends TriggerRegistryConfig> = Extract<keyof NonNullable<TRegistry['manual']>, ManualEventName>;
|
|
849
917
|
type RegisteredAutomaticEvents<TRegistry extends TriggerRegistryConfig> = Extract<keyof TRegistry['automatic'], AutomaticEventName>;
|
|
850
918
|
|
|
919
|
+
interface TrackEventInput {
|
|
920
|
+
eventType: string;
|
|
921
|
+
pageUrl?: string | null;
|
|
922
|
+
metadata?: Record<string, unknown> | null;
|
|
923
|
+
occurredAt?: Date | string | null;
|
|
924
|
+
}
|
|
925
|
+
interface TrackingClient {
|
|
926
|
+
trackEvent: (input: TrackEventInput) => void;
|
|
927
|
+
flush: () => Promise<void>;
|
|
928
|
+
getSessionId: () => string;
|
|
929
|
+
getVisitorId: () => string;
|
|
930
|
+
destroy: () => void;
|
|
931
|
+
}
|
|
932
|
+
|
|
851
933
|
interface TypedTrackEventOptions {
|
|
852
934
|
/** Override the page URL captured automatically. Rarely needed. */
|
|
853
935
|
pageUrl?: string | null;
|
|
@@ -904,4 +986,4 @@ interface CreateTrackingResult<TRegistry extends TriggerRegistryConfig> {
|
|
|
904
986
|
*/
|
|
905
987
|
declare function createTracking<TRegistry extends TriggerRegistryConfig>(options: CreateTrackingOptions<TRegistry>): CreateTrackingResult<TRegistry>;
|
|
906
988
|
|
|
907
|
-
export { type AutomaticEventName, ConsentBanner, ConsentState, type CreateTrackingOptions, type CreateTrackingResult, type CtaClickConfig, type CtaClickMetadata, type EventConfig, type EventMetadata, type EventName, type FormStartConfig, type FormStartMetadata, type FormSubmitConfig, type FormSubmitMetadata, GoogleAdsTracking, type GoogleAdsTrackingProps, type ManualEventName, type MultiPageSessionConfig, type MultiPageSessionMetadata, type PageViewConfig, type PageViewMetadata, type PhoneClickConfig, type PhoneClickMetadata, type RegisteredAutomaticEvents, type RegisteredManualEvents, type ScrollDepthConfig, type ScrollDepthMetadata, type SpecificPageName, type SpecificPageVisitConfig, type SpecificPageVisitMetadata, TRACKING_PARAM_KEYS, type TimeOnSiteConfig, type TimeOnSiteMetadata, type TrackingClient, TrackingClientContext, TrackingEventCreatePayload, TrackingInstallSurface, TrackingParams, type TrackingProviderProps, TrackingSessionUpsertPayload, type TriggerRegistryConfig, type TypedTrackEventOptions, type TypedTrackingClient, captureTrackingParamsFromLocation, createTracking, createTrackingClientContext, createTrackingEventCreatePayload, createTrackingSessionUpsertPayload, getConsentState, setConsentState, useConsentState, useGclid, useTrackingParams };
|
|
989
|
+
export { type AutomaticEventName, ConsentBanner, ConsentState, type CreateTrackingOptions, type CreateTrackingResult, type CtaClickConfig, type CtaClickMetadata, type EventConfig, type EventMetadata, type EventName, type FormStartConfig, type FormStartMetadata, type FormSubmitConfig, type FormSubmitMetadata, GoogleAdsTracking, type GoogleAdsTrackingProps, type JsonValue, type ManualEventName, type MultiPageSessionConfig, type MultiPageSessionMetadata, type PageViewConfig, type PageViewMetadata, type PhoneClickConfig, type PhoneClickMetadata, type RegisteredAutomaticEvents, type RegisteredManualEvents, type ScrollDepthConfig, type ScrollDepthMetadata, type SpecificPageName, type SpecificPageVisitConfig, type SpecificPageVisitMetadata, TRACKING_PARAM_KEYS, type TimeOnSiteConfig, type TimeOnSiteMetadata, type TrackingClient, TrackingClientContext, TrackingEventCreatePayload, TrackingInstallSurface, TrackingParams, type TrackingProviderProps, TrackingSessionUpsertPayload, type TriggerRegistryConfig, type TypedTrackEventOptions, type TypedTrackingClient, captureTrackingParamsFromLocation, createTracking, createTrackingClientContext, createTrackingEventCreatePayload, createTrackingSessionUpsertPayload, getConsentState, setConsentState, useConsentState, useGclid, useTrackingParams };
|