humanbehavior-js 0.3.3 → 0.3.4
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/cjs/index.js +11 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +11 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/tracker.ts +13 -4
package/dist/esm/index.js
CHANGED
|
@@ -5560,6 +5560,10 @@ class HumanBehaviorTracker {
|
|
|
5560
5560
|
emit: (event) => {
|
|
5561
5561
|
// ✅ DIRECT EVENT HANDLING - Let rrweb handle events natively
|
|
5562
5562
|
this.addEvent(event);
|
|
5563
|
+
// ✅ DEBUG FULLSNAPSHOT GENERATION
|
|
5564
|
+
if (event.type === 2) { // FullSnapshot
|
|
5565
|
+
logDebug(`🎯 FullSnapshot generated at ${new Date().toISOString()}`);
|
|
5566
|
+
}
|
|
5563
5567
|
},
|
|
5564
5568
|
inlineStylesheet: true,
|
|
5565
5569
|
recordCanvas: true,
|
|
@@ -5571,6 +5575,9 @@ class HumanBehaviorTracker {
|
|
|
5571
5575
|
// ✅ RRWEB BUILT-IN MASKING - More reliable than custom redaction
|
|
5572
5576
|
maskAllInputs: false, // Let users control this via selectors
|
|
5573
5577
|
maskTextSelector: this.redactionManager.getMaskTextSelector() || undefined,
|
|
5578
|
+
// ✅ FULLSNAPSHOT GENERATION - Use reasonable intervals (PostHog-style)
|
|
5579
|
+
checkoutEveryNms: 300000, // Take FullSnapshot every 5 minutes (like PostHog)
|
|
5580
|
+
checkoutEveryNth: 1000, // Take FullSnapshot every 1000 events
|
|
5574
5581
|
// ✅ SELECTOR-BASED REDACTION - Users control via CSS selectors
|
|
5575
5582
|
// No custom masking functions needed - rrweb handles this natively
|
|
5576
5583
|
});
|
|
@@ -5848,15 +5855,15 @@ class HumanBehaviorTracker {
|
|
|
5848
5855
|
}
|
|
5849
5856
|
/**
|
|
5850
5857
|
* Get current snapshot frequency info
|
|
5851
|
-
* Uses
|
|
5858
|
+
* Uses configured values (5 minutes, 1000 events) - PostHog-style
|
|
5852
5859
|
*/
|
|
5853
5860
|
getSnapshotFrequencyInfo() {
|
|
5854
5861
|
const sessionDuration = Date.now() - this.sessionStartTime;
|
|
5855
5862
|
return {
|
|
5856
5863
|
sessionDuration,
|
|
5857
|
-
currentInterval:
|
|
5858
|
-
currentThreshold:
|
|
5859
|
-
phase: '
|
|
5864
|
+
currentInterval: 300000, // Configured - 5 minutes (PostHog-style)
|
|
5865
|
+
currentThreshold: 1000, // Configured - 1000 events
|
|
5866
|
+
phase: 'configured' // Using explicit configuration
|
|
5860
5867
|
};
|
|
5861
5868
|
}
|
|
5862
5869
|
/**
|