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/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 rrweb's sensible defaults (5 seconds, 100 events)
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: 5000, // rrweb default - 5 seconds
5858
- currentThreshold: 100, // rrweb default - 100 events
5859
- phase: 'default' // Using rrweb's proven defaults
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
  /**