@devskin/browser-sdk 1.0.39 → 1.0.40

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.
@@ -863,9 +863,11 @@
863
863
  }
864
864
 
865
865
  class HeatmapCollector {
866
- constructor(config, transport) {
866
+ constructor(config, transport, anonymousId, sessionId) {
867
867
  this.config = config;
868
868
  this.transport = transport;
869
+ this.anonymousId = anonymousId;
870
+ this.sessionId = sessionId;
869
871
  this.clickData = [];
870
872
  this.scrollData = [];
871
873
  this.mouseMoveData = [];
@@ -1009,21 +1011,21 @@
1009
1011
  // Send clicks individually (backend expects one click event per item)
1010
1012
  if (this.clickData.length > 0) {
1011
1013
  this.clickData.forEach(click => {
1012
- this.transport.sendHeatmapData(Object.assign({ type: 'click' }, click));
1014
+ this.transport.sendHeatmapData(Object.assign({ type: 'click', anonymousId: this.anonymousId, sessionId: this.sessionId }, click));
1013
1015
  });
1014
1016
  this.clickData = [];
1015
1017
  }
1016
1018
  // Send scroll data individually
1017
1019
  if (this.scrollData.length > 0) {
1018
1020
  this.scrollData.forEach(scroll => {
1019
- this.transport.sendHeatmapData(Object.assign({ type: 'scroll' }, scroll));
1021
+ this.transport.sendHeatmapData(Object.assign({ type: 'scroll', anonymousId: this.anonymousId, sessionId: this.sessionId }, scroll));
1020
1022
  });
1021
1023
  this.scrollData = [];
1022
1024
  }
1023
1025
  // Send mouse moves individually
1024
1026
  if (this.mouseMoveData.length > 0) {
1025
1027
  this.mouseMoveData.forEach(move => {
1026
- this.transport.sendHeatmapData(Object.assign({ type: 'mousemove' }, move));
1028
+ this.transport.sendHeatmapData(Object.assign({ type: 'mousemove', anonymousId: this.anonymousId, sessionId: this.sessionId }, move));
1027
1029
  });
1028
1030
  this.mouseMoveData = [];
1029
1031
  }
@@ -13937,7 +13939,7 @@
13937
13939
  // Merge default heatmap config with user config
13938
13940
  const heatmapConfig = Object.assign({ enabled: true, trackClicks: true, trackScroll: true, trackMouseMovement: true, mouseMoveSampling: 0.1 }, this.config.heatmapOptions);
13939
13941
  this.config.heatmapOptions = heatmapConfig;
13940
- this.heatmapCollector = new HeatmapCollector(this.config, this.transport);
13942
+ this.heatmapCollector = new HeatmapCollector(this.config, this.transport, this.anonymousId, this.sessionId);
13941
13943
  this.heatmapCollector.start();
13942
13944
  // Initialize screenshot collector and capture page
13943
13945
  this.screenshotCollector = new ScreenshotCollector(this.config, this.transport);