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