alphana-sdk 1.9.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -96,6 +96,12 @@ interface TrackerConfig {
96
96
  sessionReplayMaskTextClass?: string;
97
97
  /** CSS class name for DOM subtrees that rrweb should not capture. */
98
98
  sessionReplayBlockClass?: string;
99
+ /**
100
+ * Cookie consent mode.
101
+ * - `auto` (default): honor the dashboard cookie-consent widget when enabled.
102
+ * - `disabled`: never show the consent banner; track immediately.
103
+ */
104
+ consentMode?: "auto" | "disabled";
99
105
  /** Called synchronously for every emitted event. */
100
106
  onEvent?: (event: TrackerEvent) => void;
101
107
  }
@@ -437,6 +443,10 @@ declare class UserTracker {
437
443
  /** Public so consumers can call logCapture.capture() for manual log entries. */
438
444
  logCapture?: LogCapture;
439
445
  private initialized;
446
+ private trackingAllowed;
447
+ private trackingBlocked;
448
+ private visitorPersisted;
449
+ private elementBindings?;
440
450
  private readonly subscribers;
441
451
  /** In-memory queue of events waiting to be flushed. */
442
452
  private queue;
@@ -454,8 +464,17 @@ declare class UserTracker {
454
464
  * Attach event listeners and start tracking.
455
465
  * Safe to call during SSR — returns `this` immediately if `window` is
456
466
  * undefined so it can be chained: `const tracker = new UserTracker(cfg).init()`.
467
+ *
468
+ * When the dashboard cookie-consent widget is enabled, tracking waits until
469
+ * the visitor accepts (or resumes a prior decision for the same config version).
457
470
  */
458
471
  init(): this;
472
+ private bootstrapRuntime;
473
+ private applyElementBindings;
474
+ private persistVisitorIfNeeded;
475
+ /** Start plugins, network flush, and element listeners after consent is OK. */
476
+ private startTracking;
477
+ private blockTracking;
459
478
  /** Remove all event listeners, flush remaining queue, and reset state. */
460
479
  destroy(): void;
461
480
  private handleVisibilityChange;
@@ -575,6 +594,7 @@ declare class UserTracker {
575
594
  /** Heatmap points for all tracked paths. */
576
595
  getHeatmapData(): Record<string, HeatmapPoint[]>;
577
596
  private get collectUrl();
597
+ private fetchRuntimeConfig;
578
598
  private currentPath;
579
599
  /**
580
600
  * Immediately drain the event queue and POST pending events to `/batch`.
@@ -96,6 +96,12 @@ interface TrackerConfig {
96
96
  sessionReplayMaskTextClass?: string;
97
97
  /** CSS class name for DOM subtrees that rrweb should not capture. */
98
98
  sessionReplayBlockClass?: string;
99
+ /**
100
+ * Cookie consent mode.
101
+ * - `auto` (default): honor the dashboard cookie-consent widget when enabled.
102
+ * - `disabled`: never show the consent banner; track immediately.
103
+ */
104
+ consentMode?: "auto" | "disabled";
99
105
  /** Called synchronously for every emitted event. */
100
106
  onEvent?: (event: TrackerEvent) => void;
101
107
  }
@@ -437,6 +443,10 @@ declare class UserTracker {
437
443
  /** Public so consumers can call logCapture.capture() for manual log entries. */
438
444
  logCapture?: LogCapture;
439
445
  private initialized;
446
+ private trackingAllowed;
447
+ private trackingBlocked;
448
+ private visitorPersisted;
449
+ private elementBindings?;
440
450
  private readonly subscribers;
441
451
  /** In-memory queue of events waiting to be flushed. */
442
452
  private queue;
@@ -454,8 +464,17 @@ declare class UserTracker {
454
464
  * Attach event listeners and start tracking.
455
465
  * Safe to call during SSR — returns `this` immediately if `window` is
456
466
  * undefined so it can be chained: `const tracker = new UserTracker(cfg).init()`.
467
+ *
468
+ * When the dashboard cookie-consent widget is enabled, tracking waits until
469
+ * the visitor accepts (or resumes a prior decision for the same config version).
457
470
  */
458
471
  init(): this;
472
+ private bootstrapRuntime;
473
+ private applyElementBindings;
474
+ private persistVisitorIfNeeded;
475
+ /** Start plugins, network flush, and element listeners after consent is OK. */
476
+ private startTracking;
477
+ private blockTracking;
459
478
  /** Remove all event listeners, flush remaining queue, and reset state. */
460
479
  destroy(): void;
461
480
  private handleVisibilityChange;
@@ -575,6 +594,7 @@ declare class UserTracker {
575
594
  /** Heatmap points for all tracked paths. */
576
595
  getHeatmapData(): Record<string, HeatmapPoint[]>;
577
596
  private get collectUrl();
597
+ private fetchRuntimeConfig;
578
598
  private currentPath;
579
599
  /**
580
600
  * Immediately drain the event queue and POST pending events to `/batch`.