@devskin/browser-sdk 1.0.51 → 1.0.53

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.
@@ -14113,11 +14113,13 @@
14113
14113
  pageUrl: window.location.href,
14114
14114
  pageTitle: document.title,
14115
14115
  };
14116
- this.transport.sendEvent(eventData);
14117
- // Flush immediately so custom events are sent before potential page navigation
14118
- this.transport.flush();
14116
+ // Send custom track events immediately via sendBeacon (synchronous, survives page navigation)
14117
+ const url = `${this.config.apiUrl || 'https://api.devskin.com'}/v1/rum/events`;
14118
+ const payload = Object.assign(Object.assign({}, eventData), { apiKey: this.config.apiKey, applicationId: this.config.appId, environment: this.config.environment, release: this.config.release });
14119
+ const blob = new Blob([JSON.stringify(payload)], { type: 'application/json' });
14120
+ navigator.sendBeacon(url, blob);
14119
14121
  if ((_d = this.config) === null || _d === void 0 ? void 0 : _d.debug) {
14120
- console.log('[DevSkin] Event tracked:', eventData);
14122
+ console.log('[DevSkin] Event tracked (beacon):', eventData);
14121
14123
  }
14122
14124
  }
14123
14125
  /**