@devskin/browser-sdk 1.0.8 → 1.0.9

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.
@@ -5005,10 +5005,9 @@
5005
5005
  }
5006
5006
  try {
5007
5007
  console.log('[RRWeb] Starting session recording:', this.sessionId);
5008
- console.log('[RRWeb] SDK Version: 1.0.7');
5008
+ console.log('[RRWeb] SDK Version: 1.0.9');
5009
5009
  this.stopFn = record({
5010
5010
  emit: (event) => {
5011
- console.log('[RRWeb] Event emitted:', { type: event.type, timestamp: event.timestamp });
5012
5011
  this.events.push(event);
5013
5012
  // Check if this is a FullSnapshot (type 2)
5014
5013
  if (event.type === 2) {
@@ -5155,18 +5154,26 @@
5155
5154
  this.enqueue('performance', metric);
5156
5155
  }
5157
5156
  sendRecordingEvents(sessionId, events) {
5158
- // DEBUG: Log event types being sent
5159
- const eventTypes = events.reduce((acc, e) => {
5160
- acc[e.type] = (acc[e.type] || 0) + 1;
5161
- return acc;
5162
- }, {});
5163
- console.log(`[DevSkin SDK] Sending ${events.length} recording events:`, eventTypes);
5164
- console.log(`[DevSkin SDK] First 3 events:`, events.slice(0, 3).map(e => ({ type: e.type, timestamp: e.timestamp })));
5165
- // Recording events can be large, send immediately
5166
- this.sendToBackend('/v1/rum/recordings', {
5167
- session_id: sessionId,
5168
- events,
5169
- timestamp: new Date().toISOString(),
5157
+ return __awaiter$1(this, void 0, void 0, function* () {
5158
+ // DEBUG: Log event types being sent
5159
+ const eventTypes = events.reduce((acc, e) => {
5160
+ acc[e.type] = (acc[e.type] || 0) + 1;
5161
+ return acc;
5162
+ }, {});
5163
+ console.log(`[DevSkin SDK] Sending ${events.length} recording events:`, eventTypes);
5164
+ console.log(`[DevSkin SDK] First 3 events:`, events.slice(0, 3).map(e => ({ type: e.type, timestamp: e.timestamp })));
5165
+ // Recording events can be large, send immediately
5166
+ try {
5167
+ yield this.sendToBackend('/v1/rum/recordings', {
5168
+ session_id: sessionId,
5169
+ events,
5170
+ timestamp: new Date().toISOString(),
5171
+ });
5172
+ console.log(`[DevSkin SDK] ✅ Recording events sent successfully`);
5173
+ }
5174
+ catch (error) {
5175
+ console.error(`[DevSkin SDK] ❌ Failed to send recording events:`, error);
5176
+ }
5170
5177
  });
5171
5178
  }
5172
5179
  sendHeatmapData(heatmapData) {
@@ -5260,6 +5267,8 @@
5260
5267
  keepalive: true,
5261
5268
  });
5262
5269
  if (!response.ok) {
5270
+ const errorText = yield response.text();
5271
+ console.error('[DevSkin] HTTP Error:', response.status, errorText);
5263
5272
  throw new Error(`HTTP ${response.status}: ${response.statusText}`);
5264
5273
  }
5265
5274
  if (this.config.debug) {
@@ -5267,11 +5276,9 @@
5267
5276
  }
5268
5277
  }
5269
5278
  catch (error) {
5270
- if (this.config.debug) {
5271
- console.error('[DevSkin] Failed to send data:', error);
5272
- }
5273
- // Retry logic could be added here
5274
- // For now, we'll just log the error
5279
+ console.error('[DevSkin] Failed to send data to', endpoint, ':', error);
5280
+ // Re-throw for caller to handle
5281
+ throw error;
5275
5282
  }
5276
5283
  });
5277
5284
  }