@devskin/browser-sdk 1.0.16 → 1.0.17

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 +1 @@
1
- {"version":3,"file":"heatmap.d.ts","sourceRoot":"","sources":["../../src/collectors/heatmap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAkCzC,qBAAa,gBAAgB;IASzB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,SAAS;IATnB,OAAO,CAAC,SAAS,CAAmB;IACpC,OAAO,CAAC,UAAU,CAAoB;IACtC,OAAO,CAAC,aAAa,CAAuB;IAC5C,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,aAAa,CAA+C;IACpE,OAAO,CAAC,iBAAiB,CAAO;gBAGtB,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,SAAS;IAG9B,KAAK,IAAI,IAAI;IAoCb,IAAI,IAAI,IAAI;IAQZ,OAAO,CAAC,WAAW;IA8CnB,OAAO,CAAC,gBAAgB;IA2CxB,OAAO,CAAC,kBAAkB;IAkC1B,OAAO,CAAC,KAAK;IA0Bb,OAAO,CAAC,kBAAkB;CAc3B"}
1
+ {"version":3,"file":"heatmap.d.ts","sourceRoot":"","sources":["../../src/collectors/heatmap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAkCzC,qBAAa,gBAAgB;IASzB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,SAAS;IATnB,OAAO,CAAC,SAAS,CAAmB;IACpC,OAAO,CAAC,UAAU,CAAoB;IACtC,OAAO,CAAC,aAAa,CAAuB;IAC5C,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,aAAa,CAA+C;IACpE,OAAO,CAAC,iBAAiB,CAAO;gBAGtB,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,SAAS;IAG9B,KAAK,IAAI,IAAI;IAoCb,IAAI,IAAI,IAAI;IAQZ,OAAO,CAAC,WAAW;IA8CnB,OAAO,CAAC,gBAAgB;IA2CxB,OAAO,CAAC,kBAAkB;IAkC1B,OAAO,CAAC,KAAK;IAmCb,OAAO,CAAC,kBAAkB;CAc3B"}
@@ -1036,24 +1036,24 @@ class HeatmapCollector {
1036
1036
  });
1037
1037
  }
1038
1038
  flush() {
1039
+ // Send clicks individually (backend expects one click event per item)
1039
1040
  if (this.clickData.length > 0) {
1040
- this.transport.sendHeatmapData({
1041
- type: 'clicks',
1042
- data: this.clickData,
1041
+ this.clickData.forEach(click => {
1042
+ this.transport.sendHeatmapData(Object.assign({ type: 'click' }, click));
1043
1043
  });
1044
1044
  this.clickData = [];
1045
1045
  }
1046
+ // Send scroll data individually
1046
1047
  if (this.scrollData.length > 0) {
1047
- this.transport.sendHeatmapData({
1048
- type: 'scroll',
1049
- data: this.scrollData,
1048
+ this.scrollData.forEach(scroll => {
1049
+ this.transport.sendHeatmapData(Object.assign({ type: 'scroll' }, scroll));
1050
1050
  });
1051
1051
  this.scrollData = [];
1052
1052
  }
1053
+ // Send mouse moves individually
1053
1054
  if (this.mouseMoveData.length > 0) {
1054
- this.transport.sendHeatmapData({
1055
- type: 'mousemove',
1056
- data: this.mouseMoveData,
1055
+ this.mouseMoveData.forEach(move => {
1056
+ this.transport.sendHeatmapData(Object.assign({ type: 'mousemove' }, move));
1057
1057
  });
1058
1058
  this.mouseMoveData = [];
1059
1059
  }
@@ -5959,7 +5959,12 @@ class DevSkinSDK {
5959
5959
  console.warn('[DevSkin] SDK already initialized');
5960
5960
  return;
5961
5961
  }
5962
- this.config = Object.assign({ debug: false, captureWebVitals: true, captureNetworkRequests: true, captureErrors: true, captureUserAgent: true, captureLocation: true, captureDevice: true }, config);
5962
+ this.config = Object.assign({ debug: false, captureWebVitals: true, captureNetworkRequests: true, captureErrors: true, captureUserAgent: true, captureLocation: true, captureDevice: true, heatmapOptions: {
5963
+ enabled: true,
5964
+ trackClicks: true,
5965
+ trackScroll: true,
5966
+ trackMouseMovement: false, // Disabled by default to avoid too much data
5967
+ } }, config);
5963
5968
  if (this.config.debug) {
5964
5969
  console.log('[DevSkin] Initializing SDK with config:', this.config);
5965
5970
  }