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 CHANGED
@@ -5564,6 +5564,10 @@ class HumanBehaviorTracker {
5564
5564
  emit: (event) => {
5565
5565
  // ✅ DIRECT EVENT HANDLING - Let rrweb handle events natively
5566
5566
  this.addEvent(event);
5567
+ // ✅ DEBUG FULLSNAPSHOT GENERATION
5568
+ if (event.type === 2) { // FullSnapshot
5569
+ logDebug(`🎯 FullSnapshot generated at ${new Date().toISOString()}`);
5570
+ }
5567
5571
  },
5568
5572
  inlineStylesheet: true,
5569
5573
  recordCanvas: true,
@@ -5575,6 +5579,9 @@ class HumanBehaviorTracker {
5575
5579
  // ✅ RRWEB BUILT-IN MASKING - More reliable than custom redaction
5576
5580
  maskAllInputs: false, // Let users control this via selectors
5577
5581
  maskTextSelector: this.redactionManager.getMaskTextSelector() || undefined,
5582
+ // ✅ FULLSNAPSHOT GENERATION - Use reasonable intervals (PostHog-style)
5583
+ checkoutEveryNms: 300000, // Take FullSnapshot every 5 minutes (like PostHog)
5584
+ checkoutEveryNth: 1000, // Take FullSnapshot every 1000 events
5578
5585
  // ✅ SELECTOR-BASED REDACTION - Users control via CSS selectors
5579
5586
  // No custom masking functions needed - rrweb handles this natively
5580
5587
  });
@@ -5852,15 +5859,15 @@ class HumanBehaviorTracker {
5852
5859
  }
5853
5860
  /**
5854
5861
  * Get current snapshot frequency info
5855
- * Uses rrweb's sensible defaults (5 seconds, 100 events)
5862
+ * Uses configured values (5 minutes, 1000 events) - PostHog-style
5856
5863
  */
5857
5864
  getSnapshotFrequencyInfo() {
5858
5865
  const sessionDuration = Date.now() - this.sessionStartTime;
5859
5866
  return {
5860
5867
  sessionDuration,
5861
- currentInterval: 5000, // rrweb default - 5 seconds
5862
- currentThreshold: 100, // rrweb default - 100 events
5863
- phase: 'default' // Using rrweb's proven defaults
5868
+ currentInterval: 300000, // Configured - 5 minutes (PostHog-style)
5869
+ currentThreshold: 1000, // Configured - 1000 events
5870
+ phase: 'configured' // Using explicit configuration
5864
5871
  };
5865
5872
  }
5866
5873
  /**