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