@devskin/browser-sdk 1.0.16 → 1.0.18
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/dist/collectors/heatmap.d.ts.map +1 -1
- package/dist/devskin.cjs.js +26 -13
- package/dist/devskin.cjs.js.map +1 -1
- package/dist/devskin.esm.js +26 -13
- package/dist/devskin.esm.js.map +1 -1
- package/dist/devskin.umd.js +26 -13
- package/dist/devskin.umd.js.map +1 -1
- package/dist/devskin.umd.min.js +3 -3
- package/dist/devskin.umd.min.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/devskin.umd.js
CHANGED
|
@@ -1038,24 +1038,24 @@
|
|
|
1038
1038
|
});
|
|
1039
1039
|
}
|
|
1040
1040
|
flush() {
|
|
1041
|
+
// Send clicks individually (backend expects one click event per item)
|
|
1041
1042
|
if (this.clickData.length > 0) {
|
|
1042
|
-
this.
|
|
1043
|
-
type: '
|
|
1044
|
-
data: this.clickData,
|
|
1043
|
+
this.clickData.forEach(click => {
|
|
1044
|
+
this.transport.sendHeatmapData(Object.assign({ type: 'click' }, click));
|
|
1045
1045
|
});
|
|
1046
1046
|
this.clickData = [];
|
|
1047
1047
|
}
|
|
1048
|
+
// Send scroll data individually
|
|
1048
1049
|
if (this.scrollData.length > 0) {
|
|
1049
|
-
this.
|
|
1050
|
-
type: 'scroll',
|
|
1051
|
-
data: this.scrollData,
|
|
1050
|
+
this.scrollData.forEach(scroll => {
|
|
1051
|
+
this.transport.sendHeatmapData(Object.assign({ type: 'scroll' }, scroll));
|
|
1052
1052
|
});
|
|
1053
1053
|
this.scrollData = [];
|
|
1054
1054
|
}
|
|
1055
|
+
// Send mouse moves individually
|
|
1055
1056
|
if (this.mouseMoveData.length > 0) {
|
|
1056
|
-
this.
|
|
1057
|
-
type: 'mousemove',
|
|
1058
|
-
data: this.mouseMoveData,
|
|
1057
|
+
this.mouseMoveData.forEach(move => {
|
|
1058
|
+
this.transport.sendHeatmapData(Object.assign({ type: 'mousemove' }, move));
|
|
1059
1059
|
});
|
|
1060
1060
|
this.mouseMoveData = [];
|
|
1061
1061
|
}
|
|
@@ -5956,12 +5956,17 @@
|
|
|
5956
5956
|
* Initialize the DevSkin SDK
|
|
5957
5957
|
*/
|
|
5958
5958
|
init(config) {
|
|
5959
|
-
var _a, _b;
|
|
5959
|
+
var _a, _b, _c, _d;
|
|
5960
5960
|
if (this.initialized) {
|
|
5961
5961
|
console.warn('[DevSkin] SDK already initialized');
|
|
5962
5962
|
return;
|
|
5963
5963
|
}
|
|
5964
|
-
this.config = Object.assign({ debug: false, captureWebVitals: true, captureNetworkRequests: true, captureErrors: true, captureUserAgent: true, captureLocation: true, captureDevice: true
|
|
5964
|
+
this.config = Object.assign({ debug: false, captureWebVitals: true, captureNetworkRequests: true, captureErrors: true, captureUserAgent: true, captureLocation: true, captureDevice: true, heatmapOptions: {
|
|
5965
|
+
enabled: true,
|
|
5966
|
+
trackClicks: true,
|
|
5967
|
+
trackScroll: true,
|
|
5968
|
+
trackMouseMovement: false, // Disabled by default to avoid too much data
|
|
5969
|
+
} }, config);
|
|
5965
5970
|
if (this.config.debug) {
|
|
5966
5971
|
console.log('[DevSkin] Initializing SDK with config:', this.config);
|
|
5967
5972
|
}
|
|
@@ -5988,12 +5993,20 @@
|
|
|
5988
5993
|
this.networkCollector.start();
|
|
5989
5994
|
}
|
|
5990
5995
|
// Initialize heatmap collector
|
|
5991
|
-
|
|
5996
|
+
// Auto-enable heatmap if session recording is enabled
|
|
5997
|
+
const heatmapEnabled = ((_a = this.config.heatmapOptions) === null || _a === void 0 ? void 0 : _a.enabled) || ((_b = this.config.sessionRecording) === null || _b === void 0 ? void 0 : _b.enabled);
|
|
5998
|
+
if (heatmapEnabled) {
|
|
5999
|
+
// Merge default heatmap config with user config
|
|
6000
|
+
const heatmapConfig = Object.assign({ enabled: true, trackClicks: true, trackScroll: true, trackMouseMovement: false }, this.config.heatmapOptions);
|
|
6001
|
+
this.config.heatmapOptions = heatmapConfig;
|
|
5992
6002
|
this.heatmapCollector = new HeatmapCollector(this.config, this.transport);
|
|
5993
6003
|
this.heatmapCollector.start();
|
|
6004
|
+
if (this.config.debug) {
|
|
6005
|
+
console.log('[DevSkin] Heatmap collection enabled', ((_c = this.config.sessionRecording) === null || _c === void 0 ? void 0 : _c.enabled) ? '(auto-enabled with session recording)' : '');
|
|
6006
|
+
}
|
|
5994
6007
|
}
|
|
5995
6008
|
// Initialize session recording with rrweb
|
|
5996
|
-
if ((
|
|
6009
|
+
if ((_d = this.config.sessionRecording) === null || _d === void 0 ? void 0 : _d.enabled) {
|
|
5997
6010
|
// Use RRWebRecorder for complete DOM recording
|
|
5998
6011
|
this.rrwebRecorder = new RRWebRecorder(this.sessionId, {
|
|
5999
6012
|
enabled: true,
|