@xylabs/pixel 5.0.94 → 5.0.96

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 CHANGED
@@ -1,62 +1,52 @@
1
1
  # @xylabs/pixel
2
2
 
3
- [![logo][]](https://xylabs.com)
3
+ [![npm][npm-badge]][npm-link]
4
+ [![license][license-badge]][license-link]
4
5
 
5
- [![main-build][]][main-build-link]
6
- [![npm-badge][]][npm-link]
7
- [![npm-downloads-badge][]][npm-link]
8
- [![jsdelivr-badge][]][jsdelivr-link]
9
- [![npm-license-badge][]](LICENSE)
10
- [![codacy-badge][]][codacy-link]
11
- [![codeclimate-badge][]][codeclimate-link]
12
- [![snyk-badge][]][snyk-link]
13
- [![socket-badge][]][socket-link]
6
+ > Event Client for xylabs ESB
14
7
 
8
+ ## Install
15
9
 
16
- Event Client for xylabs ESB
10
+ Using npm:
17
11
 
12
+ ```sh
13
+ npm install {{name}}
14
+ ```
18
15
 
16
+ Using yarn:
19
17
 
20
- ## Reference
18
+ ```sh
19
+ yarn add {{name}}
20
+ ```
21
21
 
22
- **@xylabs/pixel**
22
+ Using pnpm:
23
23
 
24
- ***
24
+ ```sh
25
+ pnpm add {{name}}
26
+ ```
25
27
 
26
- ## Classes
28
+ Using bun:
27
29
 
28
- | Class | Description |
29
- | ------ | ------ |
30
- | [PixelApi](#classes/PixelApi) | HTTP client for sending tracking events to the XY Labs pixel API. |
31
- | [XyPixel](#classes/XyPixel) | Singleton pixel tracker that queues and sends user events to the XY Labs tracking API. |
32
- | [Referrer](#classes/Referrer) | Tracks and persists the document referrer in both session and local storage. |
33
- | [UniqueUserId](#classes/UniqueUserId) | Generates and persists a unique user identifier in localStorage. |
34
- | [UserEventHandler](#classes/UserEventHandler) | Abstract base class for handling user tracking events. |
35
- | [UtmFields](#classes/UtmFields) | Tracks UTM campaign parameters from query strings, persisting history in localStorage. |
36
- | [XyUserEventHandler](#classes/XyUserEventHandler) | Concrete event handler that sends tracking events through the XyPixel singleton. |
30
+ ```sh
31
+ bun add {{name}}
32
+ ```
37
33
 
38
- ## Interfaces
39
34
 
40
- | Interface | Description |
41
- | ------ | ------ |
42
- | [UserEvent](#interfaces/UserEvent) | Represents a single user tracking event to be sent to the pixel API. |
43
- | [CommonFields](#interfaces/CommonFields) | Common fields shared across all tracking event types. |
44
- | [FunnelStartedFields](#interfaces/FunnelStartedFields) | Fields for a funnel-started tracking event. |
45
- | [PurchaseFields](#interfaces/PurchaseFields) | Fields for a purchase tracking event. |
46
- | [TestStartedFields](#interfaces/TestStartedFields) | Fields for a test-started tracking event (e.g. A/B test). |
47
- | [UserClickFields](#interfaces/UserClickFields) | Fields for a user click tracking event. |
48
- | [ViewContentFields](#interfaces/ViewContentFields) | Fields for a view-content tracking event. |
49
- | [XyLabsTrackingEventJson](#interfaces/XyLabsTrackingEventJson) | JSON structure for an XY Labs tracking event as stored or transmitted. |
35
+ ## License
50
36
 
51
- ## Type Aliases
37
+ See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
52
38
 
53
- | Type Alias | Description |
54
- | ------ | ------ |
55
- | [UserEventSystem](#type-aliases/UserEventSystem) | Parsed browser/OS/engine information from the user agent string. |
39
+ ## Reference
56
40
 
57
- ### classes
41
+ ### packages
58
42
 
59
- ### <a id="PixelApi"></a>PixelApi
43
+ ### pixel
44
+
45
+ ### .temp-typedoc
46
+
47
+ ### classes
48
+
49
+ ### <a id="PixelApi"></a>PixelApi
60
50
 
61
51
  [**@xylabs/pixel**](#../README)
62
52
 
@@ -69,14 +59,14 @@ HTTP client for sending tracking events to the XY Labs pixel API.
69
59
  ### Constructor
70
60
 
71
61
  ```ts
72
- new PixelApi(baseUri?: string): PixelApi;
62
+ new PixelApi(baseUri?): PixelApi;
73
63
  ```
74
64
 
75
65
  ### Parameters
76
66
 
77
- | Parameter | Type | Default value |
78
- | ------ | ------ | ------ |
79
- | `baseUri` | `string` | `'prod'` |
67
+ #### baseUri?
68
+
69
+ `string` = `'prod'`
80
70
 
81
71
  ### Returns
82
72
 
@@ -87,16 +77,18 @@ new PixelApi(baseUri?: string): PixelApi;
87
77
  ### trackEvents()
88
78
 
89
79
  ```ts
90
- trackEvents(events: UserEvent[]): Promise<any>;
80
+ trackEvents(events): Promise<any>;
91
81
  ```
92
82
 
93
83
  Sends an array of user events to the tracking API.
94
84
 
95
85
  ### Parameters
96
86
 
97
- | Parameter | Type | Description |
98
- | ------ | ------ | ------ |
99
- | `events` | [`UserEvent`](#../interfaces/UserEvent)[] | The events to submit |
87
+ #### events
88
+
89
+ [`UserEvent`](#../interfaces/UserEvent)[]
90
+
91
+ The events to submit
100
92
 
101
93
  ### Returns
102
94
 
@@ -104,7 +96,7 @@ Sends an array of user events to the tracking API.
104
96
 
105
97
  The response data from the API
106
98
 
107
- ### <a id="Referrer"></a>Referrer
99
+ ### <a id="Referrer"></a>Referrer
108
100
 
109
101
  [**@xylabs/pixel**](#../README)
110
102
 
@@ -126,10 +118,19 @@ new Referrer(): Referrer;
126
118
 
127
119
  ## Properties
128
120
 
129
- | Property | Type |
130
- | ------ | ------ |
131
- | <a id="local"></a> `local` | `string` |
132
- | <a id="session"></a> `session` | `string` |
121
+ ### local
122
+
123
+ ```ts
124
+ local: string;
125
+ ```
126
+
127
+ ***
128
+
129
+ ### session
130
+
131
+ ```ts
132
+ session: string;
133
+ ```
133
134
 
134
135
  ## Methods
135
136
 
@@ -156,7 +157,7 @@ Returns the referrer data as a JSON object, or undefined if both values are empt
156
157
 
157
158
  An object with local and session referrer strings, or undefined
158
159
 
159
- ### <a id="UniqueUserId"></a>UniqueUserId
160
+ ### <a id="UniqueUserId"></a>UniqueUserId
160
161
 
161
162
  [**@xylabs/pixel**](#../README)
162
163
 
@@ -178,9 +179,11 @@ new UniqueUserId(): UniqueUserId;
178
179
 
179
180
  ## Properties
180
181
 
181
- | Property | Type |
182
- | ------ | ------ |
183
- | <a id="id"></a> `id` | `string` |
182
+ ### id
183
+
184
+ ```ts
185
+ id: string;
186
+ ```
184
187
 
185
188
  ## Methods
186
189
 
@@ -196,7 +199,7 @@ Returns the unique user ID as a string.
196
199
 
197
200
  `string`
198
201
 
199
- ### <a id="UserEventHandler"></a>UserEventHandler
202
+ ### <a id="UserEventHandler"></a>UserEventHandler
200
203
 
201
204
  [**@xylabs/pixel**](#../README)
202
205
 
@@ -210,9 +213,9 @@ Abstract base class for handling user tracking events.
210
213
 
211
214
  ## Type Parameters
212
215
 
213
- | Type Parameter |
214
- | ------ |
215
- | `TData` *extends* `EmptyObject` |
216
+ ### TData
217
+
218
+ `TData` *extends* `EmptyObject`
216
219
 
217
220
  ## Constructors
218
221
 
@@ -231,22 +234,22 @@ new UserEventHandler<TData>(): UserEventHandler<TData>;
231
234
  ### funnelStarted()
232
235
 
233
236
  ```ts
234
- abstract funnelStarted<T>(fields: FunnelStartedFields | T): Promisable<void>;
237
+ abstract funnelStarted<T>(fields): Promisable<void>;
235
238
  ```
236
239
 
237
240
  Tracks a funnel-started event.
238
241
 
239
242
  ### Type Parameters
240
243
 
241
- | Type Parameter |
242
- | ------ |
243
- | `T` *extends* `object` |
244
+ #### T
245
+
246
+ `T` *extends* `object`
244
247
 
245
248
  ### Parameters
246
249
 
247
- | Parameter | Type |
248
- | ------ | ------ |
249
- | `fields` | [`FunnelStartedFields`](#../interfaces/FunnelStartedFields) \| `T` |
250
+ #### fields
251
+
252
+ [`FunnelStartedFields`](#../interfaces/FunnelStartedFields) \| `T`
250
253
 
251
254
  ### Returns
252
255
 
@@ -257,22 +260,22 @@ Tracks a funnel-started event.
257
260
  ### testStarted()
258
261
 
259
262
  ```ts
260
- abstract testStarted<T>(fields: TestStartedFields | T): Promisable<void>;
263
+ abstract testStarted<T>(fields): Promisable<void>;
261
264
  ```
262
265
 
263
266
  Tracks a test-started event.
264
267
 
265
268
  ### Type Parameters
266
269
 
267
- | Type Parameter |
268
- | ------ |
269
- | `T` *extends* `object` |
270
+ #### T
271
+
272
+ `T` *extends* `object`
270
273
 
271
274
  ### Parameters
272
275
 
273
- | Parameter | Type |
274
- | ------ | ------ |
275
- | `fields` | [`TestStartedFields`](#../interfaces/TestStartedFields) \| `T` |
276
+ #### fields
277
+
278
+ [`TestStartedFields`](#../interfaces/TestStartedFields) \| `T`
276
279
 
277
280
  ### Returns
278
281
 
@@ -283,22 +286,22 @@ Tracks a test-started event.
283
286
  ### userClick()
284
287
 
285
288
  ```ts
286
- abstract userClick<T>(fields: UserClickFields | T): Promisable<void>;
289
+ abstract userClick<T>(fields): Promisable<void>;
287
290
  ```
288
291
 
289
292
  Tracks a user click event.
290
293
 
291
294
  ### Type Parameters
292
295
 
293
- | Type Parameter |
294
- | ------ |
295
- | `T` *extends* `object` |
296
+ #### T
297
+
298
+ `T` *extends* `object`
296
299
 
297
300
  ### Parameters
298
301
 
299
- | Parameter | Type |
300
- | ------ | ------ |
301
- | `fields` | [`UserClickFields`](#../interfaces/UserClickFields) \| `T` |
302
+ #### fields
303
+
304
+ [`UserClickFields`](#../interfaces/UserClickFields) \| `T`
302
305
 
303
306
  ### Returns
304
307
 
@@ -309,28 +312,28 @@ Tracks a user click event.
309
312
  ### viewContent()
310
313
 
311
314
  ```ts
312
- abstract viewContent<T>(fields: T | ViewContentFields): Promisable<void>;
315
+ abstract viewContent<T>(fields): Promisable<void>;
313
316
  ```
314
317
 
315
318
  Tracks a view-content event.
316
319
 
317
320
  ### Type Parameters
318
321
 
319
- | Type Parameter |
320
- | ------ |
321
- | `T` *extends* `object` |
322
+ #### T
323
+
324
+ `T` *extends* `object`
322
325
 
323
326
  ### Parameters
324
327
 
325
- | Parameter | Type |
326
- | ------ | ------ |
327
- | `fields` | `T` \| [`ViewContentFields`](#../interfaces/ViewContentFields) |
328
+ #### fields
329
+
330
+ `T` \| [`ViewContentFields`](#../interfaces/ViewContentFields)
328
331
 
329
332
  ### Returns
330
333
 
331
334
  `Promisable`\<`void`\>
332
335
 
333
- ### <a id="UtmFields"></a>UtmFields
336
+ ### <a id="UtmFields"></a>UtmFields
334
337
 
335
338
  [**@xylabs/pixel**](#../README)
336
339
 
@@ -352,9 +355,11 @@ new UtmFields(): UtmFields;
352
355
 
353
356
  ## Properties
354
357
 
355
- | Property | Type | Default value |
356
- | ------ | ------ | ------ |
357
- | <a id="fields"></a> `fields` | `Record`\<`string`, `string`\>[] | `[]` |
358
+ ### fields
359
+
360
+ ```ts
361
+ fields: Record<string, string>[] = [];
362
+ ```
358
363
 
359
364
  ## Methods
360
365
 
@@ -402,7 +407,7 @@ Checks the query string for new UTM values and appends them to the history if ch
402
407
 
403
408
  The current UTM fields array, or undefined if empty
404
409
 
405
- ### <a id="XyPixel"></a>XyPixel
410
+ ### <a id="XyPixel"></a>XyPixel
406
411
 
407
412
  [**@xylabs/pixel**](#../README)
408
413
 
@@ -412,15 +417,59 @@ Singleton pixel tracker that queues and sends user events to the XY Labs trackin
412
417
 
413
418
  ## Properties
414
419
 
415
- | Property | Modifier | Type | Default value |
416
- | ------ | ------ | ------ | ------ |
417
- | <a id="api"></a> `api` | `static` | [`PixelApi`](#PixelApi) | `undefined` |
418
- | <a id="cid"></a> `cid` | `public` | `string` | `undefined` |
419
- | <a id="email"></a> `email?` | `public` | `string` | `undefined` |
420
- | <a id="email_hash"></a> `email_hash?` | `public` | `string` \| `null` | `undefined` |
421
- | <a id="exids"></a> `exids?` | `public` | `ExIds` | `undefined` |
422
- | <a id="pixelid"></a> `pixelId?` | `public` | `string` | `undefined` |
423
- | <a id="queue"></a> `queue` | `public` | [`UserEvent`](#../interfaces/UserEvent)[] | `[]` |
420
+ ### api
421
+
422
+ ```ts
423
+ static api: PixelApi;
424
+ ```
425
+
426
+ ***
427
+
428
+ ### cid
429
+
430
+ ```ts
431
+ cid: string;
432
+ ```
433
+
434
+ ***
435
+
436
+ ### email?
437
+
438
+ ```ts
439
+ optional email?: string;
440
+ ```
441
+
442
+ ***
443
+
444
+ ### email\_hash?
445
+
446
+ ```ts
447
+ optional email_hash?: string | null;
448
+ ```
449
+
450
+ ***
451
+
452
+ ### exids?
453
+
454
+ ```ts
455
+ optional exids?: ExIds;
456
+ ```
457
+
458
+ ***
459
+
460
+ ### pixelId?
461
+
462
+ ```ts
463
+ optional pixelId?: string;
464
+ ```
465
+
466
+ ***
467
+
468
+ ### queue
469
+
470
+ ```ts
471
+ queue: UserEvent[] = [];
472
+ ```
424
473
 
425
474
  ## Accessors
426
475
 
@@ -443,16 +492,18 @@ Returns the singleton XyPixel instance, throwing if not yet initialized.
443
492
  ### init()
444
493
 
445
494
  ```ts
446
- static init(pixelId: string): XyPixel;
495
+ static init(pixelId): XyPixel;
447
496
  ```
448
497
 
449
498
  Initializes the XyPixel singleton with the given pixel ID.
450
499
 
451
500
  ### Parameters
452
501
 
453
- | Parameter | Type | Description |
454
- | ------ | ------ | ------ |
455
- | `pixelId` | `string` | The pixel identifier for this tracking instance |
502
+ #### pixelId
503
+
504
+ `string`
505
+
506
+ The pixel identifier for this tracking instance
456
507
 
457
508
  ### Returns
458
509
 
@@ -465,16 +516,18 @@ The newly created XyPixel instance
465
516
  ### selectApi()
466
517
 
467
518
  ```ts
468
- static selectApi(api: PixelApi): void;
519
+ static selectApi(api): void;
469
520
  ```
470
521
 
471
522
  Replaces the default PixelApi instance used for sending events.
472
523
 
473
524
  ### Parameters
474
525
 
475
- | Parameter | Type | Description |
476
- | ------ | ------ | ------ |
477
- | `api` | [`PixelApi`](#PixelApi) | The PixelApi instance to use |
526
+ #### api
527
+
528
+ [`PixelApi`](#PixelApi)
529
+
530
+ The PixelApi instance to use
478
531
 
479
532
  ### Returns
480
533
 
@@ -485,16 +538,18 @@ Replaces the default PixelApi instance used for sending events.
485
538
  ### identify()
486
539
 
487
540
  ```ts
488
- identify(email?: string): void;
541
+ identify(email?): void;
489
542
  ```
490
543
 
491
544
  Associates an email address with this pixel instance, hashing it for privacy.
492
545
 
493
546
  ### Parameters
494
547
 
495
- | Parameter | Type | Description |
496
- | ------ | ------ | ------ |
497
- | `email?` | `string` | The email address to identify the user with |
548
+ #### email?
549
+
550
+ `string`
551
+
552
+ The email address to identify the user with
498
553
 
499
554
  ### Returns
500
555
 
@@ -506,32 +561,44 @@ Associates an email address with this pixel instance, hashing it for privacy.
506
561
 
507
562
  ```ts
508
563
  send<T>(
509
- event: string,
510
- fields?: T,
511
- eventId?: string): Promise<void>;
564
+ event,
565
+ fields?,
566
+ eventId?): Promise<void>;
512
567
  ```
513
568
 
514
569
  Queues a tracking event and attempts to flush the queue to the API.
515
570
 
516
571
  ### Type Parameters
517
572
 
518
- | Type Parameter |
519
- | ------ |
520
- | `T` *extends* `Record`\<`string`, `unknown`\> |
573
+ #### T
574
+
575
+ `T` *extends* `Record`\<`string`, `unknown`\>
521
576
 
522
577
  ### Parameters
523
578
 
524
- | Parameter | Type | Description |
525
- | ------ | ------ | ------ |
526
- | `event` | `string` | The event name |
527
- | `fields?` | `T` | Optional event-specific fields |
528
- | `eventId?` | `string` | Optional unique event identifier |
579
+ #### event
580
+
581
+ `string`
582
+
583
+ The event name
584
+
585
+ #### fields?
586
+
587
+ `T`
588
+
589
+ Optional event-specific fields
590
+
591
+ #### eventId?
592
+
593
+ `string`
594
+
595
+ Optional unique event identifier
529
596
 
530
597
  ### Returns
531
598
 
532
599
  `Promise`\<`void`\>
533
600
 
534
- ### <a id="XyUserEventHandler"></a>XyUserEventHandler
601
+ ### <a id="XyUserEventHandler"></a>XyUserEventHandler
535
602
 
536
603
  [**@xylabs/pixel**](#../README)
537
604
 
@@ -545,9 +612,9 @@ Concrete event handler that sends tracking events through the XyPixel singleton.
545
612
 
546
613
  ## Type Parameters
547
614
 
548
- | Type Parameter | Default type |
549
- | ------ | ------ |
550
- | `T` *extends* `EmptyObject` | `EmptyObject` |
615
+ ### T
616
+
617
+ `T` *extends* `EmptyObject` = `EmptyObject`
551
618
 
552
619
  ## Constructors
553
620
 
@@ -570,16 +637,16 @@ new XyUserEventHandler<T>(): XyUserEventHandler<T>;
570
637
  ### funnelStarted()
571
638
 
572
639
  ```ts
573
- funnelStarted(fields: FunnelStartedFields | T): Promise<void>;
640
+ funnelStarted(fields): Promise<void>;
574
641
  ```
575
642
 
576
643
  Sends a funnel-started event via the pixel API.
577
644
 
578
645
  ### Parameters
579
646
 
580
- | Parameter | Type |
581
- | ------ | ------ |
582
- | `fields` | [`FunnelStartedFields`](#../interfaces/FunnelStartedFields) \| `T` |
647
+ #### fields
648
+
649
+ [`FunnelStartedFields`](#../interfaces/FunnelStartedFields) \| `T`
583
650
 
584
651
  ### Returns
585
652
 
@@ -594,16 +661,16 @@ Sends a funnel-started event via the pixel API.
594
661
  ### purchase()
595
662
 
596
663
  ```ts
597
- purchase(fields: PurchaseFields | T): Promise<void>;
664
+ purchase(fields): Promise<void>;
598
665
  ```
599
666
 
600
667
  Sends a purchase event via the pixel API.
601
668
 
602
669
  ### Parameters
603
670
 
604
- | Parameter | Type |
605
- | ------ | ------ |
606
- | `fields` | [`PurchaseFields`](#../interfaces/PurchaseFields) \| `T` |
671
+ #### fields
672
+
673
+ [`PurchaseFields`](#../interfaces/PurchaseFields) \| `T`
607
674
 
608
675
  ### Returns
609
676
 
@@ -614,16 +681,16 @@ Sends a purchase event via the pixel API.
614
681
  ### testStarted()
615
682
 
616
683
  ```ts
617
- testStarted(fields: TestStartedFields | T): Promise<void>;
684
+ testStarted(fields): Promise<void>;
618
685
  ```
619
686
 
620
687
  Sends a test-started event via the pixel API.
621
688
 
622
689
  ### Parameters
623
690
 
624
- | Parameter | Type |
625
- | ------ | ------ |
626
- | `fields` | [`TestStartedFields`](#../interfaces/TestStartedFields) \| `T` |
691
+ #### fields
692
+
693
+ [`TestStartedFields`](#../interfaces/TestStartedFields) \| `T`
627
694
 
628
695
  ### Returns
629
696
 
@@ -638,16 +705,16 @@ Sends a test-started event via the pixel API.
638
705
  ### userClick()
639
706
 
640
707
  ```ts
641
- userClick(fields: UserClickFields | T): Promise<void>;
708
+ userClick(fields): Promise<void>;
642
709
  ```
643
710
 
644
711
  Sends a user click event via the pixel API.
645
712
 
646
713
  ### Parameters
647
714
 
648
- | Parameter | Type |
649
- | ------ | ------ |
650
- | `fields` | [`UserClickFields`](#../interfaces/UserClickFields) \| `T` |
715
+ #### fields
716
+
717
+ [`UserClickFields`](#../interfaces/UserClickFields) \| `T`
651
718
 
652
719
  ### Returns
653
720
 
@@ -662,16 +729,16 @@ Sends a user click event via the pixel API.
662
729
  ### viewContent()
663
730
 
664
731
  ```ts
665
- viewContent(fields: ViewContentFields | T): Promise<void>;
732
+ viewContent(fields): Promise<void>;
666
733
  ```
667
734
 
668
735
  Sends a view-content event via the pixel API.
669
736
 
670
737
  ### Parameters
671
738
 
672
- | Parameter | Type |
673
- | ------ | ------ |
674
- | `fields` | [`ViewContentFields`](#../interfaces/ViewContentFields) \| `T` |
739
+ #### fields
740
+
741
+ [`ViewContentFields`](#../interfaces/ViewContentFields) \| `T`
675
742
 
676
743
  ### Returns
677
744
 
@@ -681,9 +748,9 @@ Sends a view-content event via the pixel API.
681
748
 
682
749
  [`UserEventHandler`](#UserEventHandler).[`viewContent`](UserEventHandler.md#viewcontent)
683
750
 
684
- ### interfaces
751
+ ### interfaces
685
752
 
686
- ### <a id="CommonFields"></a>CommonFields
753
+ ### <a id="CommonFields"></a>CommonFields
687
754
 
688
755
  [**@xylabs/pixel**](#../README)
689
756
 
@@ -701,12 +768,21 @@ Common fields shared across all tracking event types.
701
768
 
702
769
  ## Properties
703
770
 
704
- | Property | Type |
705
- | ------ | ------ |
706
- | <a id="funnel"></a> `funnel?` | `string` |
707
- | <a id="testdata"></a> `testData?` | `string` |
771
+ ### funnel?
708
772
 
709
- ### <a id="FunnelStartedFields"></a>FunnelStartedFields
773
+ ```ts
774
+ optional funnel?: string;
775
+ ```
776
+
777
+ ***
778
+
779
+ ### testData?
780
+
781
+ ```ts
782
+ optional testData?: string;
783
+ ```
784
+
785
+ ### <a id="FunnelStartedFields"></a>FunnelStartedFields
710
786
 
711
787
  [**@xylabs/pixel**](#../README)
712
788
 
@@ -720,13 +796,37 @@ Fields for a funnel-started tracking event.
720
796
 
721
797
  ## Properties
722
798
 
723
- | Property | Type | Inherited from |
724
- | ------ | ------ | ------ |
725
- | <a id="funnel"></a> `funnel?` | `string` | [`CommonFields`](#CommonFields).[`funnel`](CommonFields.md#funnel) |
726
- | <a id="testdata"></a> `testData?` | `string` | [`CommonFields`](#CommonFields).[`testData`](CommonFields.md#testdata) |
727
- | <a id="name"></a> `name` | `string` | - |
799
+ ### funnel?
800
+
801
+ ```ts
802
+ optional funnel?: string;
803
+ ```
804
+
805
+ ### Inherited from
806
+
807
+ [`CommonFields`](#CommonFields).[`funnel`](CommonFields.md#funnel)
728
808
 
729
- ### <a id="PurchaseFields"></a>PurchaseFields
809
+ ***
810
+
811
+ ### testData?
812
+
813
+ ```ts
814
+ optional testData?: string;
815
+ ```
816
+
817
+ ### Inherited from
818
+
819
+ [`CommonFields`](#CommonFields).[`testData`](CommonFields.md#testdata)
820
+
821
+ ***
822
+
823
+ ### name
824
+
825
+ ```ts
826
+ name: string;
827
+ ```
828
+
829
+ ### <a id="PurchaseFields"></a>PurchaseFields
730
830
 
731
831
  [**@xylabs/pixel**](#../README)
732
832
 
@@ -740,16 +840,61 @@ Fields for a purchase tracking event.
740
840
 
741
841
  ## Properties
742
842
 
743
- | Property | Type | Inherited from |
744
- | ------ | ------ | ------ |
745
- | <a id="funnel"></a> `funnel?` | `string` | [`CommonFields`](#CommonFields).[`funnel`](CommonFields.md#funnel) |
746
- | <a id="testdata"></a> `testData?` | `string` | [`CommonFields`](#CommonFields).[`testData`](CommonFields.md#testdata) |
747
- | <a id="id"></a> `id` | `string` | - |
748
- | <a id="name"></a> `name?` | `string` | - |
749
- | <a id="price"></a> `price?` | `number` | - |
750
- | <a id="value"></a> `value?` | `number` | - |
843
+ ### funnel?
844
+
845
+ ```ts
846
+ optional funnel?: string;
847
+ ```
848
+
849
+ ### Inherited from
850
+
851
+ [`CommonFields`](#CommonFields).[`funnel`](CommonFields.md#funnel)
852
+
853
+ ***
854
+
855
+ ### testData?
856
+
857
+ ```ts
858
+ optional testData?: string;
859
+ ```
860
+
861
+ ### Inherited from
862
+
863
+ [`CommonFields`](#CommonFields).[`testData`](CommonFields.md#testdata)
864
+
865
+ ***
866
+
867
+ ### id
868
+
869
+ ```ts
870
+ id: string;
871
+ ```
872
+
873
+ ***
874
+
875
+ ### name?
751
876
 
752
- ### <a id="TestStartedFields"></a>TestStartedFields
877
+ ```ts
878
+ optional name?: string;
879
+ ```
880
+
881
+ ***
882
+
883
+ ### price?
884
+
885
+ ```ts
886
+ optional price?: number;
887
+ ```
888
+
889
+ ***
890
+
891
+ ### value?
892
+
893
+ ```ts
894
+ optional value?: number;
895
+ ```
896
+
897
+ ### <a id="TestStartedFields"></a>TestStartedFields
753
898
 
754
899
  [**@xylabs/pixel**](#../README)
755
900
 
@@ -763,13 +908,37 @@ Fields for a test-started tracking event (e.g. A/B test).
763
908
 
764
909
  ## Properties
765
910
 
766
- | Property | Type | Inherited from |
767
- | ------ | ------ | ------ |
768
- | <a id="funnel"></a> `funnel?` | `string` | [`CommonFields`](#CommonFields).[`funnel`](CommonFields.md#funnel) |
769
- | <a id="testdata"></a> `testData?` | `string` | [`CommonFields`](#CommonFields).[`testData`](CommonFields.md#testdata) |
770
- | <a id="name"></a> `name` | `string` | - |
911
+ ### funnel?
912
+
913
+ ```ts
914
+ optional funnel?: string;
915
+ ```
916
+
917
+ ### Inherited from
918
+
919
+ [`CommonFields`](#CommonFields).[`funnel`](CommonFields.md#funnel)
920
+
921
+ ***
922
+
923
+ ### testData?
924
+
925
+ ```ts
926
+ optional testData?: string;
927
+ ```
928
+
929
+ ### Inherited from
930
+
931
+ [`CommonFields`](#CommonFields).[`testData`](CommonFields.md#testdata)
932
+
933
+ ***
771
934
 
772
- ### <a id="UserClickFields"></a>UserClickFields
935
+ ### name
936
+
937
+ ```ts
938
+ name: string;
939
+ ```
940
+
941
+ ### <a id="UserClickFields"></a>UserClickFields
773
942
 
774
943
  [**@xylabs/pixel**](#../README)
775
944
 
@@ -783,16 +952,61 @@ Fields for a user click tracking event.
783
952
 
784
953
  ## Properties
785
954
 
786
- | Property | Type | Inherited from |
787
- | ------ | ------ | ------ |
788
- | <a id="funnel"></a> `funnel?` | `string` | [`CommonFields`](#CommonFields).[`funnel`](CommonFields.md#funnel) |
789
- | <a id="testdata"></a> `testData?` | `string` | [`CommonFields`](#CommonFields).[`testData`](CommonFields.md#testdata) |
790
- | <a id="elementname"></a> `elementName` | `string` | - |
791
- | <a id="elementtype"></a> `elementType` | `string` | - |
792
- | <a id="intent"></a> `intent?` | `string` | - |
793
- | <a id="placement"></a> `placement?` | `string` | - |
955
+ ### funnel?
956
+
957
+ ```ts
958
+ optional funnel?: string;
959
+ ```
960
+
961
+ ### Inherited from
962
+
963
+ [`CommonFields`](#CommonFields).[`funnel`](CommonFields.md#funnel)
964
+
965
+ ***
966
+
967
+ ### testData?
968
+
969
+ ```ts
970
+ optional testData?: string;
971
+ ```
972
+
973
+ ### Inherited from
974
+
975
+ [`CommonFields`](#CommonFields).[`testData`](CommonFields.md#testdata)
976
+
977
+ ***
978
+
979
+ ### elementName
980
+
981
+ ```ts
982
+ elementName: string;
983
+ ```
984
+
985
+ ***
986
+
987
+ ### elementType
988
+
989
+ ```ts
990
+ elementType: string;
991
+ ```
794
992
 
795
- ### <a id="UserEvent"></a>UserEvent
993
+ ***
994
+
995
+ ### intent?
996
+
997
+ ```ts
998
+ optional intent?: string;
999
+ ```
1000
+
1001
+ ***
1002
+
1003
+ ### placement?
1004
+
1005
+ ```ts
1006
+ optional placement?: string;
1007
+ ```
1008
+
1009
+ ### <a id="UserEvent"></a>UserEvent
796
1010
 
797
1011
  [**@xylabs/pixel**](#../README)
798
1012
 
@@ -802,29 +1016,153 @@ Represents a single user tracking event to be sent to the pixel API.
802
1016
 
803
1017
  ## Properties
804
1018
 
805
- | Property | Type |
806
- | ------ | ------ |
807
- | <a id="cid"></a> `cid` | `string` |
808
- | <a id="create_time"></a> `create_time?` | `number` |
809
- | <a id="email"></a> `email?` | `string` |
810
- | <a id="email_hash"></a> `email_hash?` | `string` |
811
- | <a id="event"></a> `event?` | `string` |
812
- | <a id="event_id"></a> `event_id?` | `string` |
813
- | <a id="exids"></a> `exids?` | `ExIds` |
814
- | <a id="fields"></a> `fields?` | `Record`\<`string`, `unknown`\> |
815
- | <a id="host"></a> `host?` | `string` |
816
- | <a id="pathname"></a> `pathname?` | `string` |
817
- | <a id="pixel"></a> `pixel?` | `string` |
818
- | <a id="receive_time"></a> `receive_time?` | `number` |
819
- | <a id="referrer"></a> `referrer?` | \{ `local`: `string`; `session`: `string`; \} |
820
- | `referrer.local` | `string` |
821
- | `referrer.session` | `string` |
822
- | <a id="rid"></a> `rid?` | `string` |
823
- | <a id="system"></a> `system?` | `ParsedResult` |
824
- | <a id="uid"></a> `uid?` | `string` |
825
- | <a id="utm"></a> `utm?` | `Record`\<`string`, `string`\>[] \| `Record`\<`string`, `string`[]\> |
826
-
827
- ### <a id="ViewContentFields"></a>ViewContentFields
1019
+ ### cid
1020
+
1021
+ ```ts
1022
+ cid: string;
1023
+ ```
1024
+
1025
+ ***
1026
+
1027
+ ### create\_time?
1028
+
1029
+ ```ts
1030
+ optional create_time?: number;
1031
+ ```
1032
+
1033
+ ***
1034
+
1035
+ ### email?
1036
+
1037
+ ```ts
1038
+ optional email?: string;
1039
+ ```
1040
+
1041
+ ***
1042
+
1043
+ ### email\_hash?
1044
+
1045
+ ```ts
1046
+ optional email_hash?: string;
1047
+ ```
1048
+
1049
+ ***
1050
+
1051
+ ### event?
1052
+
1053
+ ```ts
1054
+ optional event?: string;
1055
+ ```
1056
+
1057
+ ***
1058
+
1059
+ ### event\_id?
1060
+
1061
+ ```ts
1062
+ optional event_id?: string;
1063
+ ```
1064
+
1065
+ ***
1066
+
1067
+ ### exids?
1068
+
1069
+ ```ts
1070
+ optional exids?: ExIds;
1071
+ ```
1072
+
1073
+ ***
1074
+
1075
+ ### fields?
1076
+
1077
+ ```ts
1078
+ optional fields?: Record<string, unknown>;
1079
+ ```
1080
+
1081
+ ***
1082
+
1083
+ ### host?
1084
+
1085
+ ```ts
1086
+ optional host?: string;
1087
+ ```
1088
+
1089
+ ***
1090
+
1091
+ ### pathname?
1092
+
1093
+ ```ts
1094
+ optional pathname?: string;
1095
+ ```
1096
+
1097
+ ***
1098
+
1099
+ ### pixel?
1100
+
1101
+ ```ts
1102
+ optional pixel?: string;
1103
+ ```
1104
+
1105
+ ***
1106
+
1107
+ ### receive\_time?
1108
+
1109
+ ```ts
1110
+ optional receive_time?: number;
1111
+ ```
1112
+
1113
+ ***
1114
+
1115
+ ### referrer?
1116
+
1117
+ ```ts
1118
+ optional referrer?: object;
1119
+ ```
1120
+
1121
+ ### local
1122
+
1123
+ ```ts
1124
+ local: string;
1125
+ ```
1126
+
1127
+ ### session
1128
+
1129
+ ```ts
1130
+ session: string;
1131
+ ```
1132
+
1133
+ ***
1134
+
1135
+ ### rid?
1136
+
1137
+ ```ts
1138
+ optional rid?: string;
1139
+ ```
1140
+
1141
+ ***
1142
+
1143
+ ### system?
1144
+
1145
+ ```ts
1146
+ optional system?: ParsedResult;
1147
+ ```
1148
+
1149
+ ***
1150
+
1151
+ ### uid?
1152
+
1153
+ ```ts
1154
+ optional uid?: string;
1155
+ ```
1156
+
1157
+ ***
1158
+
1159
+ ### utm?
1160
+
1161
+ ```ts
1162
+ optional utm?: Record<string, string>[] | Record<string, string[]>;
1163
+ ```
1164
+
1165
+ ### <a id="ViewContentFields"></a>ViewContentFields
828
1166
 
829
1167
  [**@xylabs/pixel**](#../README)
830
1168
 
@@ -838,14 +1176,45 @@ Fields for a view-content tracking event.
838
1176
 
839
1177
  ## Properties
840
1178
 
841
- | Property | Type | Inherited from |
842
- | ------ | ------ | ------ |
843
- | <a id="funnel"></a> `funnel?` | `string` | [`CommonFields`](#CommonFields).[`funnel`](CommonFields.md#funnel) |
844
- | <a id="testdata"></a> `testData?` | `string` | [`CommonFields`](#CommonFields).[`testData`](CommonFields.md#testdata) |
845
- | <a id="name"></a> `name` | `string` | - |
846
- | <a id="path"></a> `path` | `string` | - |
1179
+ ### funnel?
1180
+
1181
+ ```ts
1182
+ optional funnel?: string;
1183
+ ```
847
1184
 
848
- ### <a id="XyLabsTrackingEventJson"></a>XyLabsTrackingEventJson
1185
+ ### Inherited from
1186
+
1187
+ [`CommonFields`](#CommonFields).[`funnel`](CommonFields.md#funnel)
1188
+
1189
+ ***
1190
+
1191
+ ### testData?
1192
+
1193
+ ```ts
1194
+ optional testData?: string;
1195
+ ```
1196
+
1197
+ ### Inherited from
1198
+
1199
+ [`CommonFields`](#CommonFields).[`testData`](CommonFields.md#testdata)
1200
+
1201
+ ***
1202
+
1203
+ ### name
1204
+
1205
+ ```ts
1206
+ name: string;
1207
+ ```
1208
+
1209
+ ***
1210
+
1211
+ ### path
1212
+
1213
+ ```ts
1214
+ path: string;
1215
+ ```
1216
+
1217
+ ### <a id="XyLabsTrackingEventJson"></a>XyLabsTrackingEventJson
849
1218
 
850
1219
  [**@xylabs/pixel**](#../README)
851
1220
 
@@ -855,77 +1224,164 @@ JSON structure for an XY Labs tracking event as stored or transmitted.
855
1224
 
856
1225
  ## Properties
857
1226
 
858
- | Property | Type |
859
- | ------ | ------ |
860
- | <a id="cid"></a> `cid` | `string` |
861
- | <a id="create_time"></a> `create_time?` | `number` |
862
- | <a id="email"></a> `email?` | `string` |
863
- | <a id="email_hash"></a> `email_hash?` | `string` |
864
- | <a id="event"></a> `event?` | `string` |
865
- | <a id="event_id"></a> `event_id?` | `string` |
866
- | <a id="exids"></a> `exids?` | `Record`\<`string`, `string`\> |
867
- | <a id="fields"></a> `fields?` | `Record`\<`string`, `unknown`\> |
868
- | <a id="host"></a> `host?` | `string` |
869
- | <a id="ip"></a> `ip?` | `string` |
870
- | <a id="pathname"></a> `pathname?` | `string` |
871
- | <a id="pixel"></a> `pixel?` | `string` |
872
- | <a id="receive_time"></a> `receive_time?` | `number` |
873
- | <a id="rid"></a> `rid?` | `string` |
874
- | <a id="system"></a> `system?` | `unknown` |
875
- | <a id="ua"></a> `ua?` | `string` |
876
- | <a id="uid"></a> `uid?` | `string` |
877
- | <a id="utm"></a> `utm?` | `Record`\<`string`, `string`\>[] \| `Record`\<`string`, `string`[]\> |
878
-
879
- ### type-aliases
880
-
881
- ### <a id="UserEventSystem"></a>UserEventSystem
1227
+ ### cid
882
1228
 
883
- [**@xylabs/pixel**](#../README)
1229
+ ```ts
1230
+ cid: string;
1231
+ ```
884
1232
 
885
1233
  ***
886
1234
 
1235
+ ### create\_time?
1236
+
887
1237
  ```ts
888
- type UserEventSystem = Bowser.Parser.ParsedResult;
1238
+ optional create_time?: number;
889
1239
  ```
890
1240
 
891
- Parsed browser/OS/engine information from the user agent string.
1241
+ ***
892
1242
 
1243
+ ### email?
893
1244
 
894
- Part of [sdk-js](https://www.npmjs.com/package/@xyo-network/sdk-js)
1245
+ ```ts
1246
+ optional email?: string;
1247
+ ```
895
1248
 
896
- ## Maintainers
1249
+ ***
897
1250
 
898
- - [Arie Trouw](https://github.com/arietrouw) ([arietrouw.com](https://arietrouw.com))
899
- - [Matt Jones](https://github.com/jonesmac)
900
- - [Joel Carter](https://github.com/JoelBCarter)
901
- - [Jordan Trouw](https://github.com/jordantrouw)
1251
+ ### email\_hash?
902
1252
 
903
- ## License
1253
+ ```ts
1254
+ optional email_hash?: string;
1255
+ ```
1256
+
1257
+ ***
904
1258
 
905
- > See the [LICENSE](LICENSE) file for license details
1259
+ ### event?
906
1260
 
907
- ## Credits
1261
+ ```ts
1262
+ optional event?: string;
1263
+ ```
908
1264
 
909
- [Made with 🔥 and ❄️ by XYLabs](https://xylabs.com)
1265
+ ***
910
1266
 
911
- [logo]: https://cdn.xy.company/img/brand/XYPersistentCompany_Logo_Icon_Colored.svg
1267
+ ### event\_id?
912
1268
 
913
- [main-build]: https://github.com/xylabs/sdk-js/actions/workflows/build.yml/badge.svg
914
- [main-build-link]: https://github.com/xylabs/sdk-js/actions/workflows/build.yml
915
- [npm-badge]: https://img.shields.io/npm/v/@xylabs/pixel.svg
916
- [npm-link]: https://www.npmjs.com/package/@xylabs/pixel
917
- [codacy-badge]: https://app.codacy.com/project/badge/Grade/c8e15e14f37741c18cfb47ac7245c698
918
- [codacy-link]: https://www.codacy.com/gh/xylabs/sdk-js/dashboard?utm_source=github.com&utm_medium=referral&utm_content=xylabs/sdk-js&utm_campaign=Badge_Grade
919
- [codeclimate-badge]: https://api.codeclimate.com/v1/badges/c5eb068f806f0b047ea7/maintainability
920
- [codeclimate-link]: https://codeclimate.com/github/xylabs/sdk-js/maintainability
921
- [snyk-badge]: https://snyk.io/test/github/xylabs/sdk-js/badge.svg?targetFile=package.json
922
- [snyk-link]: https://snyk.io/test/github/xylabs/sdk-js?targetFile=package.json
1269
+ ```ts
1270
+ optional event_id?: string;
1271
+ ```
1272
+
1273
+ ***
1274
+
1275
+ ### exids?
1276
+
1277
+ ```ts
1278
+ optional exids?: Record<string, string>;
1279
+ ```
1280
+
1281
+ ***
1282
+
1283
+ ### fields?
1284
+
1285
+ ```ts
1286
+ optional fields?: Record<string, unknown>;
1287
+ ```
1288
+
1289
+ ***
923
1290
 
924
- [npm-downloads-badge]: https://img.shields.io/npm/dw/@xylabs/pixel
925
- [npm-license-badge]: https://img.shields.io/npm/l/@xylabs/pixel
1291
+ ### host?
926
1292
 
927
- [jsdelivr-badge]: https://data.jsdelivr.com/v1/package/npm/@xylabs/pixel/badge
928
- [jsdelivr-link]: https://www.jsdelivr.com/package/npm/@xylabs/pixel
1293
+ ```ts
1294
+ optional host?: string;
1295
+ ```
1296
+
1297
+ ***
1298
+
1299
+ ### ip?
1300
+
1301
+ ```ts
1302
+ optional ip?: string;
1303
+ ```
1304
+
1305
+ ***
1306
+
1307
+ ### pathname?
1308
+
1309
+ ```ts
1310
+ optional pathname?: string;
1311
+ ```
929
1312
 
930
- [socket-badge]: https://socket.dev/api/badge/npm/package/@xylabs/pixel
931
- [socket-link]: https://socket.dev/npm/package/@xylabs/pixel
1313
+ ***
1314
+
1315
+ ### pixel?
1316
+
1317
+ ```ts
1318
+ optional pixel?: string;
1319
+ ```
1320
+
1321
+ ***
1322
+
1323
+ ### receive\_time?
1324
+
1325
+ ```ts
1326
+ optional receive_time?: number;
1327
+ ```
1328
+
1329
+ ***
1330
+
1331
+ ### rid?
1332
+
1333
+ ```ts
1334
+ optional rid?: string;
1335
+ ```
1336
+
1337
+ ***
1338
+
1339
+ ### system?
1340
+
1341
+ ```ts
1342
+ optional system?: unknown;
1343
+ ```
1344
+
1345
+ ***
1346
+
1347
+ ### ua?
1348
+
1349
+ ```ts
1350
+ optional ua?: string;
1351
+ ```
1352
+
1353
+ ***
1354
+
1355
+ ### uid?
1356
+
1357
+ ```ts
1358
+ optional uid?: string;
1359
+ ```
1360
+
1361
+ ***
1362
+
1363
+ ### utm?
1364
+
1365
+ ```ts
1366
+ optional utm?: Record<string, string>[] | Record<string, string[]>;
1367
+ ```
1368
+
1369
+ ### type-aliases
1370
+
1371
+ ### <a id="UserEventSystem"></a>UserEventSystem
1372
+
1373
+ [**@xylabs/pixel**](#../README)
1374
+
1375
+ ***
1376
+
1377
+ ```ts
1378
+ type UserEventSystem = Bowser.Parser.ParsedResult;
1379
+ ```
1380
+
1381
+ Parsed browser/OS/engine information from the user agent string.
1382
+
1383
+
1384
+ [npm-badge]: https://img.shields.io/npm/v/@xylabs/pixel.svg
1385
+ [npm-link]: https://www.npmjs.com/package/@xylabs/pixel
1386
+ [license-badge]: https://img.shields.io/npm/l/@xylabs/pixel.svg
1387
+ [license-link]: https://github.com/xylabs/sdk-js/blob/main/LICENSE