@devskin/browser-sdk 1.0.5 → 1.0.6
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.
- package/dist/devskin.cjs.js +2 -6
- package/dist/devskin.cjs.js.map +1 -1
- package/dist/devskin.esm.js +2 -6
- package/dist/devskin.esm.js.map +1 -1
- package/dist/devskin.umd.js +2 -6
- package/dist/devskin.umd.js.map +1 -1
- package/dist/devskin.umd.min.js +2 -2
- package/dist/devskin.umd.min.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/devskin.cjs.js
CHANGED
|
@@ -5517,15 +5517,11 @@ class DevSkinSDK {
|
|
|
5517
5517
|
window.addEventListener('beforeunload', () => {
|
|
5518
5518
|
var _a, _b;
|
|
5519
5519
|
this.track('page_unload');
|
|
5520
|
-
// Send session end update with duration
|
|
5520
|
+
// Send session end update with duration AND context data
|
|
5521
5521
|
if (this.sessionId && this.sessionStartTime) {
|
|
5522
5522
|
const endedAt = new Date();
|
|
5523
5523
|
const durationMs = Date.now() - this.sessionStartTime;
|
|
5524
|
-
(_a = this.transport) === null || _a === void 0 ? void 0 : _a.startSession({
|
|
5525
|
-
session_id: this.sessionId,
|
|
5526
|
-
ended_at: endedAt.toISOString(),
|
|
5527
|
-
duration_ms: durationMs,
|
|
5528
|
-
});
|
|
5524
|
+
(_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()));
|
|
5529
5525
|
}
|
|
5530
5526
|
// Send any pending data
|
|
5531
5527
|
(_b = this.transport) === null || _b === void 0 ? void 0 : _b.flush(true); // Use beacon for reliability
|