crexperium-sdk 1.2.3 → 1.2.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/browser.js +1 -1
- package/dist/browser.js.map +1 -1
- package/dist/index.js +0 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +0 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13219,18 +13219,13 @@ class SessionReplayPlugin {
|
|
|
13219
13219
|
*/
|
|
13220
13220
|
async init() {
|
|
13221
13221
|
try {
|
|
13222
|
-
console.log('[SessionReplay] Initializing session replay...');
|
|
13223
13222
|
// Start session on backend
|
|
13224
13223
|
await this.startSession();
|
|
13225
|
-
console.log('[SessionReplay] Session started on backend, sessionId:', this.session?.sessionId);
|
|
13226
13224
|
// Start rrweb recording
|
|
13227
|
-
console.log('[SessionReplay] Starting rrweb recording...');
|
|
13228
13225
|
this.startRrwebRecording();
|
|
13229
|
-
console.log('[SessionReplay] rrweb recording started');
|
|
13230
13226
|
// IMPORTANT: Flush initial events (Type 4 Meta + Type 2 Full Snapshot) immediately
|
|
13231
13227
|
// so the session is playable right away, don't wait for the 5s flush interval
|
|
13232
13228
|
setTimeout(() => {
|
|
13233
|
-
console.log('[SessionReplay] Performing initial flush of critical events...');
|
|
13234
13229
|
this.flush();
|
|
13235
13230
|
}, 100); // Small delay to ensure rrweb events are captured
|
|
13236
13231
|
// Intercept console methods
|
|
@@ -13305,17 +13300,9 @@ class SessionReplayPlugin {
|
|
|
13305
13300
|
this.stopRecording = record({
|
|
13306
13301
|
emit: (event) => {
|
|
13307
13302
|
// Debug: Log event types
|
|
13308
|
-
if (event.type === 4) {
|
|
13309
|
-
console.log('[SessionReplay] Captured Meta event (type 4)');
|
|
13310
|
-
}
|
|
13311
|
-
else if (event.type === 2) {
|
|
13312
|
-
console.log('[SessionReplay] Captured Full Snapshot event (type 2)');
|
|
13313
|
-
}
|
|
13314
13303
|
this.eventBuffer.push(event);
|
|
13315
|
-
console.log(`[SessionReplay] Event buffered. Type: ${event.type}, Buffer size: ${this.eventBuffer.length}`);
|
|
13316
13304
|
// Auto-flush if buffer reaches max size
|
|
13317
13305
|
if (this.eventBuffer.length >= (this.config.buffering?.maxBufferSize || 100)) {
|
|
13318
|
-
console.log('[SessionReplay] Buffer full, flushing...');
|
|
13319
13306
|
this.flush();
|
|
13320
13307
|
}
|
|
13321
13308
|
},
|
|
@@ -13657,16 +13644,12 @@ class SessionReplayPlugin {
|
|
|
13657
13644
|
* Flush buffered events to backend
|
|
13658
13645
|
*/
|
|
13659
13646
|
async flush() {
|
|
13660
|
-
console.log(`[SessionReplay] flush() called. Session: ${!!this.session}, Event buffer: ${this.eventBuffer.length}, Telemetry buffer: ${this.telemetryBuffer.length}`);
|
|
13661
13647
|
if (!this.session) {
|
|
13662
|
-
console.warn('[SessionReplay] flush() skipped - no session yet!');
|
|
13663
13648
|
return;
|
|
13664
13649
|
}
|
|
13665
13650
|
if (this.eventBuffer.length === 0 && this.telemetryBuffer.length === 0) {
|
|
13666
|
-
console.log('[SessionReplay] flush() skipped - buffers empty');
|
|
13667
13651
|
return;
|
|
13668
13652
|
}
|
|
13669
|
-
console.log(`[SessionReplay] Flushing ${this.eventBuffer.length} events to backend...`);
|
|
13670
13653
|
const eventsToSend = [...this.eventBuffer];
|
|
13671
13654
|
const telemetryToSend = [...this.telemetryBuffer];
|
|
13672
13655
|
// Clear buffers
|