@aranova/tracking-react 1.18.0 → 1.20.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.
@@ -1,6 +1,6 @@
1
+ import { J as JsonValue, j as FormSubmitConfig, k as FormSubmitMetadata } from './phone-utils-BlWj8oxq.mjs';
1
2
  import * as zod_v4_core from 'zod/v4/core';
2
3
  import * as z from 'zod/mini';
3
- import { J as JsonValue, j as FormSubmitConfig, k as FormSubmitMetadata } from './phone-utils-BlWj8oxq.mjs';
4
4
 
5
5
  /**
6
6
  * Metadata for a manually fired `cta_click` event.
@@ -387,6 +387,80 @@ declare const timeOnSiteConfigSchema: z.ZodMiniObject<{
387
387
  }, z.core.$strict>;
388
388
  type TimeOnSiteConfig = z.infer<typeof timeOnSiteConfigSchema>;
389
389
 
390
+ declare const videoVariantSchema: z.ZodMiniEnum<{
391
+ "16x9": "16x9";
392
+ "9x16": "9x16";
393
+ }>;
394
+ type VideoVariant = z.infer<typeof videoVariantSchema>;
395
+ declare const videoProgressTriggerReasonSchema: z.ZodMiniEnum<{
396
+ goal: "goal";
397
+ ended: "ended";
398
+ pause: "pause";
399
+ page_exit: "page_exit";
400
+ checkpoint: "checkpoint";
401
+ seek: "seek";
402
+ }>;
403
+ type VideoProgressTriggerReason = z.infer<typeof videoProgressTriggerReasonSchema>;
404
+ declare const videoRangeSchema: z.ZodMiniObject<{
405
+ start_s: z.ZodMiniNumber<number>;
406
+ end_s: z.ZodMiniNumber<number>;
407
+ }, z.core.$strict>;
408
+ type VideoWatchRange = z.infer<typeof videoRangeSchema>;
409
+ /** Metadata for `video_play` emitted when playback starts or resumes on `<TrackedVideo>`. */
410
+ declare const videoPlayMetadataSchema: z.ZodMiniObject<{
411
+ video_id: z.ZodMiniString<string>;
412
+ variant: z.ZodMiniEnum<{
413
+ "16x9": "16x9";
414
+ "9x16": "9x16";
415
+ }>;
416
+ current_s: z.ZodMiniNumber<number>;
417
+ duration_s: z.ZodMiniNumber<number>;
418
+ play_sequence: z.ZodMiniInt;
419
+ page: z.ZodMiniObject<{
420
+ path: z.ZodMiniString<string>;
421
+ }, z.core.$strict>;
422
+ }, z.core.$strict>;
423
+ type VideoPlayMetadata = z.infer<typeof videoPlayMetadataSchema>;
424
+ declare const videoPlayConfigSchema: z.ZodMiniObject<{}, z.core.$strict>;
425
+ type VideoPlayConfig = z.infer<typeof videoPlayConfigSchema>;
426
+ /**
427
+ * Metadata for `video_progress` emitted at checkpoints, goal thresholds, pause, seek, ended, and page_exit.
428
+ * `ranges` carries cumulative merged `[start_s, end_s]` intervals watched in the session so far.
429
+ */
430
+ declare const videoProgressMetadataSchema: z.ZodMiniObject<{
431
+ video_id: z.ZodMiniString<string>;
432
+ variant: z.ZodMiniEnum<{
433
+ "16x9": "16x9";
434
+ "9x16": "9x16";
435
+ }>;
436
+ trigger: z.ZodMiniEnum<{
437
+ goal: "goal";
438
+ ended: "ended";
439
+ pause: "pause";
440
+ page_exit: "page_exit";
441
+ checkpoint: "checkpoint";
442
+ seek: "seek";
443
+ }>;
444
+ current_s: z.ZodMiniNumber<number>;
445
+ furthest_s: z.ZodMiniNumber<number>;
446
+ watched_s: z.ZodMiniNumber<number>;
447
+ duration_s: z.ZodMiniNumber<number>;
448
+ max_percent: z.ZodMiniInt;
449
+ watched_percent: z.ZodMiniInt;
450
+ play_count: z.ZodMiniInt;
451
+ seek_count: z.ZodMiniInt;
452
+ ranges: z.ZodMiniArray<z.ZodMiniObject<{
453
+ start_s: z.ZodMiniNumber<number>;
454
+ end_s: z.ZodMiniNumber<number>;
455
+ }, z.core.$strict>>;
456
+ page: z.ZodMiniObject<{
457
+ path: z.ZodMiniString<string>;
458
+ }, z.core.$strict>;
459
+ }, z.core.$strict>;
460
+ type VideoProgressMetadata = z.infer<typeof videoProgressMetadataSchema>;
461
+ declare const videoProgressConfigSchema: z.ZodMiniObject<{}, z.core.$strict>;
462
+ type VideoProgressConfig = z.infer<typeof videoProgressConfigSchema>;
463
+
390
464
  type EventOutcomeRole = "lead" | "engagement" | "navigation" | "diagnostic";
391
465
  type EventCategory = "page" | "engagement" | "lead" | "commerce" | "system";
392
466
  type EventClientVisibility = "simple" | "detailed" | "hidden";
@@ -492,6 +566,18 @@ declare const EVENT_SEMANTICS: {
492
566
  readonly outcomeRole: "navigation";
493
567
  readonly clientVisibility: "simple";
494
568
  };
569
+ readonly video_play: {
570
+ readonly label: "Video played";
571
+ readonly category: "engagement";
572
+ readonly outcomeRole: "engagement";
573
+ readonly clientVisibility: "simple";
574
+ };
575
+ readonly video_progress: {
576
+ readonly label: "Video watched";
577
+ readonly category: "engagement";
578
+ readonly outcomeRole: "engagement";
579
+ readonly clientVisibility: "detailed";
580
+ };
495
581
  };
496
582
  type EventName = keyof typeof EVENT_SEMANTICS;
497
583
  declare function getEventSemantics(eventName: string): EventSemantics | null;
@@ -703,6 +789,69 @@ declare const EVENT_REGISTRY: {
703
789
  }, zod_v4_core.$strict>;
704
790
  readonly configSchema: z.ZodMiniObject<{}, zod_v4_core.$strict>;
705
791
  };
792
+ readonly video_play: {
793
+ readonly kind: "automatic";
794
+ readonly semantics: {
795
+ readonly label: "Video played";
796
+ readonly category: "engagement";
797
+ readonly outcomeRole: "engagement";
798
+ readonly clientVisibility: "simple";
799
+ };
800
+ readonly metadataSchema: z.ZodMiniObject<{
801
+ video_id: z.ZodMiniString<string>;
802
+ variant: z.ZodMiniEnum<{
803
+ "16x9": "16x9";
804
+ "9x16": "9x16";
805
+ }>;
806
+ current_s: z.ZodMiniNumber<number>;
807
+ duration_s: z.ZodMiniNumber<number>;
808
+ play_sequence: z.ZodMiniInt;
809
+ page: z.ZodMiniObject<{
810
+ path: z.ZodMiniString<string>;
811
+ }, zod_v4_core.$strict>;
812
+ }, zod_v4_core.$strict>;
813
+ readonly configSchema: z.ZodMiniObject<{}, zod_v4_core.$strict>;
814
+ };
815
+ readonly video_progress: {
816
+ readonly kind: "automatic";
817
+ readonly semantics: {
818
+ readonly label: "Video watched";
819
+ readonly category: "engagement";
820
+ readonly outcomeRole: "engagement";
821
+ readonly clientVisibility: "detailed";
822
+ };
823
+ readonly metadataSchema: z.ZodMiniObject<{
824
+ video_id: z.ZodMiniString<string>;
825
+ variant: z.ZodMiniEnum<{
826
+ "16x9": "16x9";
827
+ "9x16": "9x16";
828
+ }>;
829
+ trigger: z.ZodMiniEnum<{
830
+ goal: "goal";
831
+ ended: "ended";
832
+ pause: "pause";
833
+ page_exit: "page_exit";
834
+ checkpoint: "checkpoint";
835
+ seek: "seek";
836
+ }>;
837
+ current_s: z.ZodMiniNumber<number>;
838
+ furthest_s: z.ZodMiniNumber<number>;
839
+ watched_s: z.ZodMiniNumber<number>;
840
+ duration_s: z.ZodMiniNumber<number>;
841
+ max_percent: z.ZodMiniInt;
842
+ watched_percent: z.ZodMiniInt;
843
+ play_count: z.ZodMiniInt;
844
+ seek_count: z.ZodMiniInt;
845
+ ranges: z.ZodMiniArray<z.ZodMiniObject<{
846
+ start_s: z.ZodMiniNumber<number>;
847
+ end_s: z.ZodMiniNumber<number>;
848
+ }, zod_v4_core.$strict>>;
849
+ page: z.ZodMiniObject<{
850
+ path: z.ZodMiniString<string>;
851
+ }, zod_v4_core.$strict>;
852
+ }, zod_v4_core.$strict>;
853
+ readonly configSchema: z.ZodMiniObject<{}, zod_v4_core.$strict>;
854
+ };
706
855
  readonly form_submit: {
707
856
  readonly kind: "manual";
708
857
  readonly semantics: {
@@ -879,6 +1028,8 @@ type MetadataByName = {
879
1028
  page_exit: PageExitMetadata;
880
1029
  site_link_click: SiteLinkClickMetadata;
881
1030
  site_link_arrival: SiteLinkArrivalMetadata;
1031
+ video_play: VideoPlayMetadata;
1032
+ video_progress: VideoProgressMetadata;
882
1033
  form_submit: FormSubmitMetadata;
883
1034
  form_step: FormStepMetadata;
884
1035
  form_details: FormDetailsMetadata;
@@ -896,6 +1047,8 @@ type ConfigByName = {
896
1047
  page_exit: PageExitConfig;
897
1048
  site_link_click: SiteLinkClickConfig;
898
1049
  site_link_arrival: SiteLinkArrivalConfig;
1050
+ video_play: VideoPlayConfig;
1051
+ video_progress: VideoProgressConfig;
899
1052
  form_submit: FormSubmitConfig;
900
1053
  form_step: FormStepConfig;
901
1054
  form_details: FormDetailsConfig;
@@ -979,6 +1132,51 @@ type TrackableEvent<TRegistry extends TriggerRegistryConfig> = {
979
1132
  };
980
1133
  }[RegisteredManualEvents<TRegistry>];
981
1134
 
1135
+ /**
1136
+ * Input accepted by the low-level stringly-typed client.
1137
+ *
1138
+ * Prefer the typed `trackEvent(eventName, metadata)` facade exposed by
1139
+ * `useTracking()` in React/Next integrations.
1140
+ */
1141
+ interface TrackEventInput {
1142
+ /** Event name to enqueue. */
1143
+ eventType: string;
1144
+ /** URL associated with the event. Defaults to the current page URL. */
1145
+ pageUrl?: string | null;
1146
+ /** Event-specific metadata. */
1147
+ metadata?: Record<string, unknown> | null;
1148
+ /** Timestamp override. Defaults to queue time. */
1149
+ occurredAt?: Date | string | null;
1150
+ }
1151
+ /**
1152
+ * Low-level tracking client responsible for queueing and flushing events.
1153
+ */
1154
+ interface TrackingClient {
1155
+ /** Enqueue an event for batched delivery. */
1156
+ trackEvent: (input: TrackEventInput) => void;
1157
+ /** Flush queued events immediately (fetch, non-keepalive). */
1158
+ flush: () => Promise<void>;
1159
+ /**
1160
+ * Flush queued events through the keepalive transport so the request
1161
+ * survives document unload. Use from `pagehide`/`visibilitychange:hidden`
1162
+ * handlers — a plain `flush()` there is aborted by the browser on unload.
1163
+ */
1164
+ flushBeacon: () => void;
1165
+ /**
1166
+ * Register a synchronous pre-unload hook invoked right before `flushBeacon`
1167
+ * snapshots the queue into a keepalive batch. Used by `page_exit` and
1168
+ * `<TrackedVideo>` so their final segment/progress events ride in the same
1169
+ * keepalive request as any queued events.
1170
+ */
1171
+ onBeforeUnload?: (listener: () => void) => () => void;
1172
+ /** Return the current rolling session id. */
1173
+ getSessionId: () => string;
1174
+ /** Return the persistent visitor id. */
1175
+ getVisitorId: () => string;
1176
+ /** Remove timers/listeners and prevent future flushes. */
1177
+ destroy: () => void;
1178
+ }
1179
+
982
1180
  interface TypedTrackEventOptions {
983
1181
  /**
984
1182
  * Override the page URL associated with this event.
@@ -1023,4 +1221,4 @@ interface TypedTrackingClient<TRegistry extends TriggerRegistryConfig> {
1023
1221
  getVisitorId(): string;
1024
1222
  }
1025
1223
 
1026
- export { type AutomaticEventName as A, type SiteLinkArrivalConfig as B, type CtaClickConfig as C, type SiteLinkArrivalMetadata as D, EVENT_SEMANTICS as E, type FormDetailsConfig as F, type SiteLinkClickConfig as G, type SiteLinkClickMetadata as H, type SpecificPageName as I, type SpecificPageVisitConfig as J, type SpecificPageVisitMetadata as K, type TimeOnSiteMetadata as L, type ManualEventName as M, type TrackableEvent as N, type TriggerRegistryConfig as O, type PageExitConfig as P, type TypedTrackEventOptions as Q, type RegisteredAutomaticEvents as R, type ScrollDepthConfig as S, type TimeOnSiteConfig as T, type TypedTrackingClient as U, getEventSemantics as V, type CtaClickMetadata as a, type EventCategory as b, type EventClientVisibility as c, type EventConfig as d, type EventKind as e, type EventMetadata as f, type EventName as g, type EventOutcomeRole as h, type EventSemantics as i, type FormDetailsMetadata as j, type FormStartConfig as k, type FormStartMetadata as l, type FormStepConfig as m, type FormStepMetadata as n, type MultiPageSessionConfig as o, type MultiPageSessionMetadata as p, type PageExitMetadata as q, type PageIdentity as r, type PageViewConfig as s, type PageViewMetadata as t, type PhoneClickConfig as u, type PhoneClickMetadata as v, type RegisteredManualEvents as w, type ScrollDepthMetadata as x, type SdkHeartbeatConfig as y, type SdkHeartbeatMetadata as z };
1224
+ export { type VideoVariant as $, type AutomaticEventName as A, type SiteLinkArrivalConfig as B, type CtaClickConfig as C, type SiteLinkArrivalMetadata as D, EVENT_SEMANTICS as E, type FormDetailsConfig as F, type SiteLinkClickConfig as G, type SiteLinkClickMetadata as H, type SpecificPageName as I, type SpecificPageVisitConfig as J, type SpecificPageVisitMetadata as K, type TimeOnSiteMetadata as L, type ManualEventName as M, type TrackableEvent as N, type TrackingClient as O, type PageExitConfig as P, type TriggerRegistryConfig as Q, type RegisteredAutomaticEvents as R, type ScrollDepthConfig as S, type TimeOnSiteConfig as T, type TypedTrackEventOptions as U, type TypedTrackingClient as V, type VideoPlayConfig as W, type VideoPlayMetadata as X, type VideoProgressConfig as Y, type VideoProgressMetadata as Z, type VideoProgressTriggerReason as _, type CtaClickMetadata as a, type VideoWatchRange as a0, getEventSemantics as a1, type EventCategory as b, type EventClientVisibility as c, type EventConfig as d, type EventKind as e, type EventMetadata as f, type EventName as g, type EventOutcomeRole as h, type EventSemantics as i, type FormDetailsMetadata as j, type FormStartConfig as k, type FormStartMetadata as l, type FormStepConfig as m, type FormStepMetadata as n, type MultiPageSessionConfig as o, type MultiPageSessionMetadata as p, type PageExitMetadata as q, type PageIdentity as r, type PageViewConfig as s, type PageViewMetadata as t, type PhoneClickConfig as u, type PhoneClickMetadata as v, type RegisteredManualEvents as w, type ScrollDepthMetadata as x, type SdkHeartbeatConfig as y, type SdkHeartbeatMetadata as z };
@@ -1,6 +1,6 @@
1
+ import { J as JsonValue, j as FormSubmitConfig, k as FormSubmitMetadata } from './phone-utils-BlWj8oxq.js';
1
2
  import * as zod_v4_core from 'zod/v4/core';
2
3
  import * as z from 'zod/mini';
3
- import { J as JsonValue, j as FormSubmitConfig, k as FormSubmitMetadata } from './phone-utils-BlWj8oxq.js';
4
4
 
5
5
  /**
6
6
  * Metadata for a manually fired `cta_click` event.
@@ -387,6 +387,80 @@ declare const timeOnSiteConfigSchema: z.ZodMiniObject<{
387
387
  }, z.core.$strict>;
388
388
  type TimeOnSiteConfig = z.infer<typeof timeOnSiteConfigSchema>;
389
389
 
390
+ declare const videoVariantSchema: z.ZodMiniEnum<{
391
+ "16x9": "16x9";
392
+ "9x16": "9x16";
393
+ }>;
394
+ type VideoVariant = z.infer<typeof videoVariantSchema>;
395
+ declare const videoProgressTriggerReasonSchema: z.ZodMiniEnum<{
396
+ goal: "goal";
397
+ ended: "ended";
398
+ pause: "pause";
399
+ page_exit: "page_exit";
400
+ checkpoint: "checkpoint";
401
+ seek: "seek";
402
+ }>;
403
+ type VideoProgressTriggerReason = z.infer<typeof videoProgressTriggerReasonSchema>;
404
+ declare const videoRangeSchema: z.ZodMiniObject<{
405
+ start_s: z.ZodMiniNumber<number>;
406
+ end_s: z.ZodMiniNumber<number>;
407
+ }, z.core.$strict>;
408
+ type VideoWatchRange = z.infer<typeof videoRangeSchema>;
409
+ /** Metadata for `video_play` emitted when playback starts or resumes on `<TrackedVideo>`. */
410
+ declare const videoPlayMetadataSchema: z.ZodMiniObject<{
411
+ video_id: z.ZodMiniString<string>;
412
+ variant: z.ZodMiniEnum<{
413
+ "16x9": "16x9";
414
+ "9x16": "9x16";
415
+ }>;
416
+ current_s: z.ZodMiniNumber<number>;
417
+ duration_s: z.ZodMiniNumber<number>;
418
+ play_sequence: z.ZodMiniInt;
419
+ page: z.ZodMiniObject<{
420
+ path: z.ZodMiniString<string>;
421
+ }, z.core.$strict>;
422
+ }, z.core.$strict>;
423
+ type VideoPlayMetadata = z.infer<typeof videoPlayMetadataSchema>;
424
+ declare const videoPlayConfigSchema: z.ZodMiniObject<{}, z.core.$strict>;
425
+ type VideoPlayConfig = z.infer<typeof videoPlayConfigSchema>;
426
+ /**
427
+ * Metadata for `video_progress` emitted at checkpoints, goal thresholds, pause, seek, ended, and page_exit.
428
+ * `ranges` carries cumulative merged `[start_s, end_s]` intervals watched in the session so far.
429
+ */
430
+ declare const videoProgressMetadataSchema: z.ZodMiniObject<{
431
+ video_id: z.ZodMiniString<string>;
432
+ variant: z.ZodMiniEnum<{
433
+ "16x9": "16x9";
434
+ "9x16": "9x16";
435
+ }>;
436
+ trigger: z.ZodMiniEnum<{
437
+ goal: "goal";
438
+ ended: "ended";
439
+ pause: "pause";
440
+ page_exit: "page_exit";
441
+ checkpoint: "checkpoint";
442
+ seek: "seek";
443
+ }>;
444
+ current_s: z.ZodMiniNumber<number>;
445
+ furthest_s: z.ZodMiniNumber<number>;
446
+ watched_s: z.ZodMiniNumber<number>;
447
+ duration_s: z.ZodMiniNumber<number>;
448
+ max_percent: z.ZodMiniInt;
449
+ watched_percent: z.ZodMiniInt;
450
+ play_count: z.ZodMiniInt;
451
+ seek_count: z.ZodMiniInt;
452
+ ranges: z.ZodMiniArray<z.ZodMiniObject<{
453
+ start_s: z.ZodMiniNumber<number>;
454
+ end_s: z.ZodMiniNumber<number>;
455
+ }, z.core.$strict>>;
456
+ page: z.ZodMiniObject<{
457
+ path: z.ZodMiniString<string>;
458
+ }, z.core.$strict>;
459
+ }, z.core.$strict>;
460
+ type VideoProgressMetadata = z.infer<typeof videoProgressMetadataSchema>;
461
+ declare const videoProgressConfigSchema: z.ZodMiniObject<{}, z.core.$strict>;
462
+ type VideoProgressConfig = z.infer<typeof videoProgressConfigSchema>;
463
+
390
464
  type EventOutcomeRole = "lead" | "engagement" | "navigation" | "diagnostic";
391
465
  type EventCategory = "page" | "engagement" | "lead" | "commerce" | "system";
392
466
  type EventClientVisibility = "simple" | "detailed" | "hidden";
@@ -492,6 +566,18 @@ declare const EVENT_SEMANTICS: {
492
566
  readonly outcomeRole: "navigation";
493
567
  readonly clientVisibility: "simple";
494
568
  };
569
+ readonly video_play: {
570
+ readonly label: "Video played";
571
+ readonly category: "engagement";
572
+ readonly outcomeRole: "engagement";
573
+ readonly clientVisibility: "simple";
574
+ };
575
+ readonly video_progress: {
576
+ readonly label: "Video watched";
577
+ readonly category: "engagement";
578
+ readonly outcomeRole: "engagement";
579
+ readonly clientVisibility: "detailed";
580
+ };
495
581
  };
496
582
  type EventName = keyof typeof EVENT_SEMANTICS;
497
583
  declare function getEventSemantics(eventName: string): EventSemantics | null;
@@ -703,6 +789,69 @@ declare const EVENT_REGISTRY: {
703
789
  }, zod_v4_core.$strict>;
704
790
  readonly configSchema: z.ZodMiniObject<{}, zod_v4_core.$strict>;
705
791
  };
792
+ readonly video_play: {
793
+ readonly kind: "automatic";
794
+ readonly semantics: {
795
+ readonly label: "Video played";
796
+ readonly category: "engagement";
797
+ readonly outcomeRole: "engagement";
798
+ readonly clientVisibility: "simple";
799
+ };
800
+ readonly metadataSchema: z.ZodMiniObject<{
801
+ video_id: z.ZodMiniString<string>;
802
+ variant: z.ZodMiniEnum<{
803
+ "16x9": "16x9";
804
+ "9x16": "9x16";
805
+ }>;
806
+ current_s: z.ZodMiniNumber<number>;
807
+ duration_s: z.ZodMiniNumber<number>;
808
+ play_sequence: z.ZodMiniInt;
809
+ page: z.ZodMiniObject<{
810
+ path: z.ZodMiniString<string>;
811
+ }, zod_v4_core.$strict>;
812
+ }, zod_v4_core.$strict>;
813
+ readonly configSchema: z.ZodMiniObject<{}, zod_v4_core.$strict>;
814
+ };
815
+ readonly video_progress: {
816
+ readonly kind: "automatic";
817
+ readonly semantics: {
818
+ readonly label: "Video watched";
819
+ readonly category: "engagement";
820
+ readonly outcomeRole: "engagement";
821
+ readonly clientVisibility: "detailed";
822
+ };
823
+ readonly metadataSchema: z.ZodMiniObject<{
824
+ video_id: z.ZodMiniString<string>;
825
+ variant: z.ZodMiniEnum<{
826
+ "16x9": "16x9";
827
+ "9x16": "9x16";
828
+ }>;
829
+ trigger: z.ZodMiniEnum<{
830
+ goal: "goal";
831
+ ended: "ended";
832
+ pause: "pause";
833
+ page_exit: "page_exit";
834
+ checkpoint: "checkpoint";
835
+ seek: "seek";
836
+ }>;
837
+ current_s: z.ZodMiniNumber<number>;
838
+ furthest_s: z.ZodMiniNumber<number>;
839
+ watched_s: z.ZodMiniNumber<number>;
840
+ duration_s: z.ZodMiniNumber<number>;
841
+ max_percent: z.ZodMiniInt;
842
+ watched_percent: z.ZodMiniInt;
843
+ play_count: z.ZodMiniInt;
844
+ seek_count: z.ZodMiniInt;
845
+ ranges: z.ZodMiniArray<z.ZodMiniObject<{
846
+ start_s: z.ZodMiniNumber<number>;
847
+ end_s: z.ZodMiniNumber<number>;
848
+ }, zod_v4_core.$strict>>;
849
+ page: z.ZodMiniObject<{
850
+ path: z.ZodMiniString<string>;
851
+ }, zod_v4_core.$strict>;
852
+ }, zod_v4_core.$strict>;
853
+ readonly configSchema: z.ZodMiniObject<{}, zod_v4_core.$strict>;
854
+ };
706
855
  readonly form_submit: {
707
856
  readonly kind: "manual";
708
857
  readonly semantics: {
@@ -879,6 +1028,8 @@ type MetadataByName = {
879
1028
  page_exit: PageExitMetadata;
880
1029
  site_link_click: SiteLinkClickMetadata;
881
1030
  site_link_arrival: SiteLinkArrivalMetadata;
1031
+ video_play: VideoPlayMetadata;
1032
+ video_progress: VideoProgressMetadata;
882
1033
  form_submit: FormSubmitMetadata;
883
1034
  form_step: FormStepMetadata;
884
1035
  form_details: FormDetailsMetadata;
@@ -896,6 +1047,8 @@ type ConfigByName = {
896
1047
  page_exit: PageExitConfig;
897
1048
  site_link_click: SiteLinkClickConfig;
898
1049
  site_link_arrival: SiteLinkArrivalConfig;
1050
+ video_play: VideoPlayConfig;
1051
+ video_progress: VideoProgressConfig;
899
1052
  form_submit: FormSubmitConfig;
900
1053
  form_step: FormStepConfig;
901
1054
  form_details: FormDetailsConfig;
@@ -979,6 +1132,51 @@ type TrackableEvent<TRegistry extends TriggerRegistryConfig> = {
979
1132
  };
980
1133
  }[RegisteredManualEvents<TRegistry>];
981
1134
 
1135
+ /**
1136
+ * Input accepted by the low-level stringly-typed client.
1137
+ *
1138
+ * Prefer the typed `trackEvent(eventName, metadata)` facade exposed by
1139
+ * `useTracking()` in React/Next integrations.
1140
+ */
1141
+ interface TrackEventInput {
1142
+ /** Event name to enqueue. */
1143
+ eventType: string;
1144
+ /** URL associated with the event. Defaults to the current page URL. */
1145
+ pageUrl?: string | null;
1146
+ /** Event-specific metadata. */
1147
+ metadata?: Record<string, unknown> | null;
1148
+ /** Timestamp override. Defaults to queue time. */
1149
+ occurredAt?: Date | string | null;
1150
+ }
1151
+ /**
1152
+ * Low-level tracking client responsible for queueing and flushing events.
1153
+ */
1154
+ interface TrackingClient {
1155
+ /** Enqueue an event for batched delivery. */
1156
+ trackEvent: (input: TrackEventInput) => void;
1157
+ /** Flush queued events immediately (fetch, non-keepalive). */
1158
+ flush: () => Promise<void>;
1159
+ /**
1160
+ * Flush queued events through the keepalive transport so the request
1161
+ * survives document unload. Use from `pagehide`/`visibilitychange:hidden`
1162
+ * handlers — a plain `flush()` there is aborted by the browser on unload.
1163
+ */
1164
+ flushBeacon: () => void;
1165
+ /**
1166
+ * Register a synchronous pre-unload hook invoked right before `flushBeacon`
1167
+ * snapshots the queue into a keepalive batch. Used by `page_exit` and
1168
+ * `<TrackedVideo>` so their final segment/progress events ride in the same
1169
+ * keepalive request as any queued events.
1170
+ */
1171
+ onBeforeUnload?: (listener: () => void) => () => void;
1172
+ /** Return the current rolling session id. */
1173
+ getSessionId: () => string;
1174
+ /** Return the persistent visitor id. */
1175
+ getVisitorId: () => string;
1176
+ /** Remove timers/listeners and prevent future flushes. */
1177
+ destroy: () => void;
1178
+ }
1179
+
982
1180
  interface TypedTrackEventOptions {
983
1181
  /**
984
1182
  * Override the page URL associated with this event.
@@ -1023,4 +1221,4 @@ interface TypedTrackingClient<TRegistry extends TriggerRegistryConfig> {
1023
1221
  getVisitorId(): string;
1024
1222
  }
1025
1223
 
1026
- export { type AutomaticEventName as A, type SiteLinkArrivalConfig as B, type CtaClickConfig as C, type SiteLinkArrivalMetadata as D, EVENT_SEMANTICS as E, type FormDetailsConfig as F, type SiteLinkClickConfig as G, type SiteLinkClickMetadata as H, type SpecificPageName as I, type SpecificPageVisitConfig as J, type SpecificPageVisitMetadata as K, type TimeOnSiteMetadata as L, type ManualEventName as M, type TrackableEvent as N, type TriggerRegistryConfig as O, type PageExitConfig as P, type TypedTrackEventOptions as Q, type RegisteredAutomaticEvents as R, type ScrollDepthConfig as S, type TimeOnSiteConfig as T, type TypedTrackingClient as U, getEventSemantics as V, type CtaClickMetadata as a, type EventCategory as b, type EventClientVisibility as c, type EventConfig as d, type EventKind as e, type EventMetadata as f, type EventName as g, type EventOutcomeRole as h, type EventSemantics as i, type FormDetailsMetadata as j, type FormStartConfig as k, type FormStartMetadata as l, type FormStepConfig as m, type FormStepMetadata as n, type MultiPageSessionConfig as o, type MultiPageSessionMetadata as p, type PageExitMetadata as q, type PageIdentity as r, type PageViewConfig as s, type PageViewMetadata as t, type PhoneClickConfig as u, type PhoneClickMetadata as v, type RegisteredManualEvents as w, type ScrollDepthMetadata as x, type SdkHeartbeatConfig as y, type SdkHeartbeatMetadata as z };
1224
+ export { type VideoVariant as $, type AutomaticEventName as A, type SiteLinkArrivalConfig as B, type CtaClickConfig as C, type SiteLinkArrivalMetadata as D, EVENT_SEMANTICS as E, type FormDetailsConfig as F, type SiteLinkClickConfig as G, type SiteLinkClickMetadata as H, type SpecificPageName as I, type SpecificPageVisitConfig as J, type SpecificPageVisitMetadata as K, type TimeOnSiteMetadata as L, type ManualEventName as M, type TrackableEvent as N, type TrackingClient as O, type PageExitConfig as P, type TriggerRegistryConfig as Q, type RegisteredAutomaticEvents as R, type ScrollDepthConfig as S, type TimeOnSiteConfig as T, type TypedTrackEventOptions as U, type TypedTrackingClient as V, type VideoPlayConfig as W, type VideoPlayMetadata as X, type VideoProgressConfig as Y, type VideoProgressMetadata as Z, type VideoProgressTriggerReason as _, type CtaClickMetadata as a, type VideoWatchRange as a0, getEventSemantics as a1, type EventCategory as b, type EventClientVisibility as c, type EventConfig as d, type EventKind as e, type EventMetadata as f, type EventName as g, type EventOutcomeRole as h, type EventSemantics as i, type FormDetailsMetadata as j, type FormStartConfig as k, type FormStartMetadata as l, type FormStepConfig as m, type FormStepMetadata as n, type MultiPageSessionConfig as o, type MultiPageSessionMetadata as p, type PageExitMetadata as q, type PageIdentity as r, type PageViewConfig as s, type PageViewMetadata as t, type PhoneClickConfig as u, type PhoneClickMetadata as v, type RegisteredManualEvents as w, type ScrollDepthMetadata as x, type SdkHeartbeatConfig as y, type SdkHeartbeatMetadata as z };
@@ -1,5 +1,5 @@
1
1
  import * as z from 'zod/mini';
2
- import { S as SalesBookingsClient, w as ConversionConfigStore, a2 as TrackingConfigRuntime } from './bookings-CCGpXhYE.js';
2
+ import { S as SalesBookingsClient, w as ConversionConfigStore, a4 as TrackingConfigRuntime } from './bookings-CSDPoT-I.js';
3
3
  import { CountryCode } from 'libphonenumber-js';
4
4
 
5
5
  /** Raw identifiers a caller may hand us (normalized before use). */
@@ -1,5 +1,5 @@
1
1
  import * as z from 'zod/mini';
2
- import { S as SalesBookingsClient, w as ConversionConfigStore, a2 as TrackingConfigRuntime } from './bookings-CVvpj_8K.mjs';
2
+ import { S as SalesBookingsClient, w as ConversionConfigStore, a4 as TrackingConfigRuntime } from './bookings-BpLjL5w1.mjs';
3
3
  import { CountryCode } from 'libphonenumber-js';
4
4
 
5
5
  /** Raw identifiers a caller may hand us (normalized before use). */
package/dist/sales.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- export { A as AranovaApiError, B as BusinessConfig, a as BusinessConfigFeatures, b as BusinessConfigService, C as CompareTo, d as CurrencyRevenue, e as CustomerCurrencyDelta, f as CustomerCurrencyTotal, g as CustomerGetOptions, h as CustomerGetResult, i as CustomerKpis, j as CustomerKpisDeltas, k as CustomerKpisPrevious, l as CustomerListPage, m as CustomerListQuery, n as CustomerProfile, o as CustomerSegment, p as CustomerSegmentCount, q as CustomerSortField, r as CustomerSummary, s as CustomerSummaryQuery, D as DistinctCustomersByCurrency, E as EffectiveSaleProperty, G as Granularity, N as NAMED_RANGES, t as NamedRange, P as PublicServiceItem, S as SALE_SOURCES, u as SUPPORTED_CURRENCIES, v as Sale, w as SaleBuiltinRequirableField, x as SaleCursorPage, y as SaleFilters, z as SaleInput, F as SaleItem, H as SaleItemInput, I as SaleKeysetSortField, J as SaleListPage, K as SaleListQuery, L as SaleListQueryV2, M as SalePropertyOption, O as SalePropertyType, Q as SaleService, R as SaleServiceInput, T as SaleSortField, U as SaleSortOrder, V as SaleSource, W as SaleSourceFacts, X as SaleSummary, Y as SaleSummaryPrevious, Z as SaleSummaryQuery, _ as SaleSummaryQueryV2, $ as SaleSummaryV2, a0 as SaleUpdateInput, a1 as SalesBusinessClient, a2 as SalesCategoryBreakdown, a3 as SalesClient, a4 as SalesClientConfig, a5 as SalesCustomersClient, a6 as SalesServiceBreakdown, a7 as SalesTransportConfig, a8 as SalesTrendPoint, a9 as SummaryCurrencyDelta, aa as SummaryDeltas, ab as SummaryWindow, ac as SupportedCurrency, ad as TRACKING_RANGES, ae as TrackingOverviewRange, ag as createSalesClient, ah as currencySchema, ai as fetchServices, aj as formatDateInTz, ak as formatMoney, al as fromMinor, am as saleCreateSchema, an as saleItemSchema, ao as saleServiceSchema, ap as saleUpdateSchema, aq as salesRequest, as as toMinor } from './sales-B1ONR-Yi.mjs';
2
- export { a as BookingDetailsFailure, b as BookingDetailsInput, c as BookingDetailsOptions, d as BookingDetailsOutcome, e as BookingDetailsStatus, f as BookingDropOff, g as BookingFormSubmit, i as BookingInput, j as BookingInputFor, l as BookingMode, p as BookingOutcome, s as BookingServiceKey, t as BookingSimulation, u as BookingSubmitOptions, v as BookingVehicle, F as FormSubmitField, S as SalesBookingsClient, X as newBookingAttemptKey } from './bookings-CVvpj_8K.mjs';
1
+ export { A as AranovaApiError, B as BusinessConfig, a as BusinessConfigFeatures, b as BusinessConfigService, C as CompareTo, d as CurrencyRevenue, e as CustomerCurrencyDelta, f as CustomerCurrencyTotal, g as CustomerGetOptions, h as CustomerGetResult, i as CustomerKpis, j as CustomerKpisDeltas, k as CustomerKpisPrevious, l as CustomerListPage, m as CustomerListQuery, n as CustomerProfile, o as CustomerSegment, p as CustomerSegmentCount, q as CustomerSortField, r as CustomerSummary, s as CustomerSummaryQuery, D as DistinctCustomersByCurrency, E as EffectiveSaleProperty, G as Granularity, N as NAMED_RANGES, t as NamedRange, P as PublicServiceItem, S as SALE_SOURCES, u as SUPPORTED_CURRENCIES, v as Sale, w as SaleBuiltinRequirableField, x as SaleCursorPage, y as SaleFilters, z as SaleInput, F as SaleItem, H as SaleItemInput, I as SaleKeysetSortField, J as SaleListPage, K as SaleListQuery, L as SaleListQueryV2, M as SalePropertyOption, O as SalePropertyType, Q as SaleService, R as SaleServiceInput, T as SaleSortField, U as SaleSortOrder, V as SaleSource, W as SaleSourceFacts, X as SaleSummary, Y as SaleSummaryPrevious, Z as SaleSummaryQuery, _ as SaleSummaryQueryV2, $ as SaleSummaryV2, a0 as SaleUpdateInput, a1 as SalesBusinessClient, a2 as SalesCategoryBreakdown, a3 as SalesClient, a4 as SalesClientConfig, a5 as SalesCustomersClient, a6 as SalesServiceBreakdown, a7 as SalesTransportConfig, a8 as SalesTrendPoint, a9 as SummaryCurrencyDelta, aa as SummaryDeltas, ab as SummaryWindow, ac as SupportedCurrency, ad as TRACKING_RANGES, ae as TrackingOverviewRange, ag as createSalesClient, ah as currencySchema, ai as fetchServices, aj as formatDateInTz, ak as formatMoney, al as fromMinor, am as saleCreateSchema, an as saleItemSchema, ao as saleServiceSchema, ap as saleUpdateSchema, aq as salesRequest, as as toMinor } from './sales-agx4zLC9.mjs';
2
+ export { a as BookingDetailsFailure, b as BookingDetailsInput, c as BookingDetailsOptions, d as BookingDetailsOutcome, e as BookingDetailsStatus, f as BookingDropOff, g as BookingFormSubmit, i as BookingInput, j as BookingInputFor, l as BookingMode, p as BookingOutcome, s as BookingServiceKey, t as BookingSimulation, u as BookingSubmitOptions, v as BookingVehicle, F as FormSubmitField, S as SalesBookingsClient, Z as newBookingAttemptKey } from './bookings-BpLjL5w1.mjs';
3
3
  import 'zod/mini';
4
4
  import 'libphonenumber-js';
5
5
  import './phone-utils-BlWj8oxq.mjs';
package/dist/sales.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { A as AranovaApiError, B as BusinessConfig, a as BusinessConfigFeatures, b as BusinessConfigService, C as CompareTo, d as CurrencyRevenue, e as CustomerCurrencyDelta, f as CustomerCurrencyTotal, g as CustomerGetOptions, h as CustomerGetResult, i as CustomerKpis, j as CustomerKpisDeltas, k as CustomerKpisPrevious, l as CustomerListPage, m as CustomerListQuery, n as CustomerProfile, o as CustomerSegment, p as CustomerSegmentCount, q as CustomerSortField, r as CustomerSummary, s as CustomerSummaryQuery, D as DistinctCustomersByCurrency, E as EffectiveSaleProperty, G as Granularity, N as NAMED_RANGES, t as NamedRange, P as PublicServiceItem, S as SALE_SOURCES, u as SUPPORTED_CURRENCIES, v as Sale, w as SaleBuiltinRequirableField, x as SaleCursorPage, y as SaleFilters, z as SaleInput, F as SaleItem, H as SaleItemInput, I as SaleKeysetSortField, J as SaleListPage, K as SaleListQuery, L as SaleListQueryV2, M as SalePropertyOption, O as SalePropertyType, Q as SaleService, R as SaleServiceInput, T as SaleSortField, U as SaleSortOrder, V as SaleSource, W as SaleSourceFacts, X as SaleSummary, Y as SaleSummaryPrevious, Z as SaleSummaryQuery, _ as SaleSummaryQueryV2, $ as SaleSummaryV2, a0 as SaleUpdateInput, a1 as SalesBusinessClient, a2 as SalesCategoryBreakdown, a3 as SalesClient, a4 as SalesClientConfig, a5 as SalesCustomersClient, a6 as SalesServiceBreakdown, a7 as SalesTransportConfig, a8 as SalesTrendPoint, a9 as SummaryCurrencyDelta, aa as SummaryDeltas, ab as SummaryWindow, ac as SupportedCurrency, ad as TRACKING_RANGES, ae as TrackingOverviewRange, ag as createSalesClient, ah as currencySchema, ai as fetchServices, aj as formatDateInTz, ak as formatMoney, al as fromMinor, am as saleCreateSchema, an as saleItemSchema, ao as saleServiceSchema, ap as saleUpdateSchema, aq as salesRequest, as as toMinor } from './sales-Dlc_umAV.js';
2
- export { a as BookingDetailsFailure, b as BookingDetailsInput, c as BookingDetailsOptions, d as BookingDetailsOutcome, e as BookingDetailsStatus, f as BookingDropOff, g as BookingFormSubmit, i as BookingInput, j as BookingInputFor, l as BookingMode, p as BookingOutcome, s as BookingServiceKey, t as BookingSimulation, u as BookingSubmitOptions, v as BookingVehicle, F as FormSubmitField, S as SalesBookingsClient, X as newBookingAttemptKey } from './bookings-CCGpXhYE.js';
1
+ export { A as AranovaApiError, B as BusinessConfig, a as BusinessConfigFeatures, b as BusinessConfigService, C as CompareTo, d as CurrencyRevenue, e as CustomerCurrencyDelta, f as CustomerCurrencyTotal, g as CustomerGetOptions, h as CustomerGetResult, i as CustomerKpis, j as CustomerKpisDeltas, k as CustomerKpisPrevious, l as CustomerListPage, m as CustomerListQuery, n as CustomerProfile, o as CustomerSegment, p as CustomerSegmentCount, q as CustomerSortField, r as CustomerSummary, s as CustomerSummaryQuery, D as DistinctCustomersByCurrency, E as EffectiveSaleProperty, G as Granularity, N as NAMED_RANGES, t as NamedRange, P as PublicServiceItem, S as SALE_SOURCES, u as SUPPORTED_CURRENCIES, v as Sale, w as SaleBuiltinRequirableField, x as SaleCursorPage, y as SaleFilters, z as SaleInput, F as SaleItem, H as SaleItemInput, I as SaleKeysetSortField, J as SaleListPage, K as SaleListQuery, L as SaleListQueryV2, M as SalePropertyOption, O as SalePropertyType, Q as SaleService, R as SaleServiceInput, T as SaleSortField, U as SaleSortOrder, V as SaleSource, W as SaleSourceFacts, X as SaleSummary, Y as SaleSummaryPrevious, Z as SaleSummaryQuery, _ as SaleSummaryQueryV2, $ as SaleSummaryV2, a0 as SaleUpdateInput, a1 as SalesBusinessClient, a2 as SalesCategoryBreakdown, a3 as SalesClient, a4 as SalesClientConfig, a5 as SalesCustomersClient, a6 as SalesServiceBreakdown, a7 as SalesTransportConfig, a8 as SalesTrendPoint, a9 as SummaryCurrencyDelta, aa as SummaryDeltas, ab as SummaryWindow, ac as SupportedCurrency, ad as TRACKING_RANGES, ae as TrackingOverviewRange, ag as createSalesClient, ah as currencySchema, ai as fetchServices, aj as formatDateInTz, ak as formatMoney, al as fromMinor, am as saleCreateSchema, an as saleItemSchema, ao as saleServiceSchema, ap as saleUpdateSchema, aq as salesRequest, as as toMinor } from './sales-CM_dxsf8.js';
2
+ export { a as BookingDetailsFailure, b as BookingDetailsInput, c as BookingDetailsOptions, d as BookingDetailsOutcome, e as BookingDetailsStatus, f as BookingDropOff, g as BookingFormSubmit, i as BookingInput, j as BookingInputFor, l as BookingMode, p as BookingOutcome, s as BookingServiceKey, t as BookingSimulation, u as BookingSubmitOptions, v as BookingVehicle, F as FormSubmitField, S as SalesBookingsClient, Z as newBookingAttemptKey } from './bookings-CSDPoT-I.js';
3
3
  import 'zod/mini';
4
4
  import 'libphonenumber-js';
5
5
  import './phone-utils-BlWj8oxq.js';