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