@devskin/browser-sdk 1.0.27 → 1.0.28

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.
@@ -517,7 +517,7 @@
517
517
  stack: error.stack,
518
518
  type: error.name || 'Error',
519
519
  timestamp: new Date().toISOString(),
520
- session_id: '', // Will be set by transport
520
+ sessionId: '', // Will be set by transport
521
521
  url: window.location.href,
522
522
  breadcrumbs: [...this.breadcrumbs],
523
523
  context: Object.assign(Object.assign({}, context), { userAgent: navigator.userAgent, viewport: {
@@ -540,7 +540,7 @@
540
540
  message: String(error),
541
541
  type: 'Error',
542
542
  timestamp: new Date().toISOString(),
543
- session_id: '',
543
+ sessionId: '',
544
544
  url: window.location.href,
545
545
  breadcrumbs: [...this.breadcrumbs],
546
546
  context,
@@ -13750,7 +13750,7 @@
13750
13750
  sendToBackendXHR(endpoint, data) {
13751
13751
  return __awaiter$1(this, void 0, void 0, function* () {
13752
13752
  const url = `${this.apiUrl}${endpoint}`;
13753
- const payload = Object.assign(Object.assign({}, data), { apiKey: this.config.apiKey, appId: this.config.appId, environment: this.config.environment, release: this.config.release });
13753
+ const payload = Object.assign(Object.assign({}, data), { apiKey: this.config.apiKey, applicationId: this.config.appId, environment: this.config.environment, release: this.config.release });
13754
13754
  // Apply beforeSend hook if provided
13755
13755
  if (this.config.beforeSend) {
13756
13756
  const processed = this.config.beforeSend(payload);
@@ -13800,7 +13800,7 @@
13800
13800
  sendToBackend(endpoint_1, data_1) {
13801
13801
  return __awaiter$1(this, arguments, void 0, function* (endpoint, data, useBeacon = false) {
13802
13802
  const url = `${this.apiUrl}${endpoint}`;
13803
- const payload = Object.assign(Object.assign({}, data), { apiKey: this.config.apiKey, appId: this.config.appId, environment: this.config.environment, release: this.config.release });
13803
+ const payload = Object.assign(Object.assign({}, data), { apiKey: this.config.apiKey, applicationId: this.config.appId, environment: this.config.environment, release: this.config.release });
13804
13804
  // Apply beforeSend hook if provided
13805
13805
  if (this.config.beforeSend) {
13806
13806
  const processed = this.config.beforeSend(payload);
@@ -13984,15 +13984,15 @@
13984
13984
  return;
13985
13985
  }
13986
13986
  const eventData = {
13987
- event_name: eventName,
13988
- event_type: 'track',
13987
+ eventName: eventName,
13988
+ eventType: 'track',
13989
13989
  timestamp: new Date().toISOString(),
13990
- session_id: this.sessionId,
13991
- user_id: this.userId || undefined,
13992
- anonymous_id: this.anonymousId || undefined,
13990
+ sessionId: this.sessionId,
13991
+ userId: this.userId || undefined,
13992
+ anonymousId: this.anonymousId || undefined,
13993
13993
  properties: Object.assign(Object.assign({}, properties), this.getContextData()),
13994
- page_url: window.location.href,
13995
- page_title: document.title,
13994
+ pageUrl: window.location.href,
13995
+ pageTitle: document.title,
13996
13996
  };
13997
13997
  (_a = this.transport) === null || _a === void 0 ? void 0 : _a.sendEvent(eventData);
13998
13998
  if ((_b = this.config) === null || _b === void 0 ? void 0 : _b.debug) {
@@ -14033,10 +14033,10 @@
14033
14033
  }
14034
14034
  this.userId = userId;
14035
14035
  const userData = {
14036
- user_id: userId,
14037
- anonymous_id: this.anonymousId || undefined,
14036
+ userId: userId,
14037
+ anonymousId: this.anonymousId || undefined,
14038
14038
  traits: Object.assign(Object.assign({}, traits), this.getContextData()),
14039
- session_id: this.sessionId,
14039
+ sessionId: this.sessionId,
14040
14040
  timestamp: new Date().toISOString(),
14041
14041
  };
14042
14042
  (_a = this.transport) === null || _a === void 0 ? void 0 : _a.identifyUser(userData);
@@ -14110,7 +14110,7 @@
14110
14110
  // Store in sessionStorage (persists across page navigations in same tab)
14111
14111
  sessionStorage.setItem('devskin_session_id', this.sessionId);
14112
14112
  sessionStorage.setItem('devskin_session_start', this.sessionStartTime.toString());
14113
- const sessionData = Object.assign({ session_id: this.sessionId, user_id: this.userId || undefined, anonymous_id: this.anonymousId, started_at: new Date().toISOString() }, this.getContextData());
14113
+ const sessionData = Object.assign({ sessionId: this.sessionId, userId: this.userId || undefined, anonymousId: this.anonymousId, startedAt: new Date().toISOString(), platform: 'web' }, this.getContextData());
14114
14114
  (_b = this.transport) === null || _b === void 0 ? void 0 : _b.startSession(sessionData);
14115
14115
  if ((_c = this.config) === null || _c === void 0 ? void 0 : _c.debug) {
14116
14116
  console.log('[DevSkin] New session created:', this.sessionId);
@@ -14171,7 +14171,7 @@
14171
14171
  if (this.sessionId && this.sessionStartTime) {
14172
14172
  const endedAt = new Date();
14173
14173
  const durationMs = Date.now() - this.sessionStartTime;
14174
- (_a = this.transport) === null || _a === void 0 ? void 0 : _a.startSession(Object.assign({ session_id: this.sessionId, user_id: this.userId || undefined, anonymous_id: this.anonymousId, ended_at: endedAt.toISOString(), duration_ms: durationMs }, this.getContextData()));
14174
+ (_a = this.transport) === null || _a === void 0 ? void 0 : _a.startSession(Object.assign({ sessionId: this.sessionId, userId: this.userId || undefined, anonymousId: this.anonymousId, endedAt: endedAt.toISOString(), durationMs: durationMs, platform: 'web' }, this.getContextData()));
14175
14175
  // Clear session storage since session is ending
14176
14176
  sessionStorage.removeItem('devskin_session_id');
14177
14177
  sessionStorage.removeItem('devskin_session_start');