@devskin/browser-sdk 1.0.28 → 1.0.29

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.
@@ -13710,9 +13710,12 @@ class Transport {
13710
13710
  }
13711
13711
  }
13712
13712
  enqueue(type, data) {
13713
+ // Add applicationId to RUM events (event, error, network, performance)
13714
+ // Heatmap uses apiKey/appId in payload root instead
13715
+ const enrichedData = type !== 'heatmap' ? Object.assign(Object.assign({}, data), { applicationId: this.config.appId }) : data;
13713
13716
  this.queue.push({
13714
13717
  type,
13715
- data,
13718
+ data: enrichedData,
13716
13719
  timestamp: Date.now(),
13717
13720
  });
13718
13721
  // Flush if queue is full
@@ -14111,15 +14114,33 @@ class DevSkinSDK {
14111
14114
  }
14112
14115
  }
14113
14116
  getContextData() {
14117
+ var _a, _b, _c, _d;
14114
14118
  const context = {};
14119
+ // Flatten device data to match backend schema
14115
14120
  if (this.deviceCollector) {
14116
- context.device = this.deviceCollector.collect();
14121
+ const device = this.deviceCollector.collect();
14122
+ context.deviceType = device.type;
14123
+ context.deviceModel = device.model;
14124
+ context.osName = (_a = device.os) === null || _a === void 0 ? void 0 : _a.name;
14125
+ context.osVersion = (_b = device.os) === null || _b === void 0 ? void 0 : _b.version;
14126
+ context.screenWidth = (_c = device.screen) === null || _c === void 0 ? void 0 : _c.width;
14127
+ context.screenHeight = (_d = device.screen) === null || _d === void 0 ? void 0 : _d.height;
14128
+ context.viewportWidth = window.innerWidth;
14129
+ context.viewportHeight = window.innerHeight;
14117
14130
  }
14131
+ // Flatten browser data to match backend schema
14118
14132
  if (this.browserCollector) {
14119
- context.browser = this.browserCollector.collect();
14133
+ const browser = this.browserCollector.collect();
14134
+ context.browserName = browser.name;
14135
+ context.browserVersion = browser.version;
14136
+ context.userAgent = browser.userAgent;
14120
14137
  }
14138
+ // Flatten location data to match backend schema
14121
14139
  if (this.locationCollector) {
14122
- context.location = this.locationCollector.collect();
14140
+ const location = this.locationCollector.collect();
14141
+ context.country = location.country;
14142
+ context.city = location.city;
14143
+ context.ipAddress = undefined; // Will be set by backend from request
14123
14144
  }
14124
14145
  return context;
14125
14146
  }