@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.
- package/dist/devskin.cjs.js +16 -16
- package/dist/devskin.cjs.js.map +1 -1
- package/dist/devskin.esm.js +16 -16
- package/dist/devskin.esm.js.map +1 -1
- package/dist/devskin.umd.js +16 -16
- package/dist/devskin.umd.js.map +1 -1
- package/dist/devskin.umd.min.js +3 -3
- package/dist/devskin.umd.min.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/types.d.ts +21 -20
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/devskin.cjs.js
CHANGED
|
@@ -515,7 +515,7 @@ class ErrorCollector {
|
|
|
515
515
|
stack: error.stack,
|
|
516
516
|
type: error.name || 'Error',
|
|
517
517
|
timestamp: new Date().toISOString(),
|
|
518
|
-
|
|
518
|
+
sessionId: '', // Will be set by transport
|
|
519
519
|
url: window.location.href,
|
|
520
520
|
breadcrumbs: [...this.breadcrumbs],
|
|
521
521
|
context: Object.assign(Object.assign({}, context), { userAgent: navigator.userAgent, viewport: {
|
|
@@ -538,7 +538,7 @@ class ErrorCollector {
|
|
|
538
538
|
message: String(error),
|
|
539
539
|
type: 'Error',
|
|
540
540
|
timestamp: new Date().toISOString(),
|
|
541
|
-
|
|
541
|
+
sessionId: '',
|
|
542
542
|
url: window.location.href,
|
|
543
543
|
breadcrumbs: [...this.breadcrumbs],
|
|
544
544
|
context,
|
|
@@ -13748,7 +13748,7 @@ class Transport {
|
|
|
13748
13748
|
sendToBackendXHR(endpoint, data) {
|
|
13749
13749
|
return __awaiter$1(this, void 0, void 0, function* () {
|
|
13750
13750
|
const url = `${this.apiUrl}${endpoint}`;
|
|
13751
|
-
const payload = Object.assign(Object.assign({}, data), { apiKey: this.config.apiKey,
|
|
13751
|
+
const payload = Object.assign(Object.assign({}, data), { apiKey: this.config.apiKey, applicationId: this.config.appId, environment: this.config.environment, release: this.config.release });
|
|
13752
13752
|
// Apply beforeSend hook if provided
|
|
13753
13753
|
if (this.config.beforeSend) {
|
|
13754
13754
|
const processed = this.config.beforeSend(payload);
|
|
@@ -13798,7 +13798,7 @@ class Transport {
|
|
|
13798
13798
|
sendToBackend(endpoint_1, data_1) {
|
|
13799
13799
|
return __awaiter$1(this, arguments, void 0, function* (endpoint, data, useBeacon = false) {
|
|
13800
13800
|
const url = `${this.apiUrl}${endpoint}`;
|
|
13801
|
-
const payload = Object.assign(Object.assign({}, data), { apiKey: this.config.apiKey,
|
|
13801
|
+
const payload = Object.assign(Object.assign({}, data), { apiKey: this.config.apiKey, applicationId: this.config.appId, environment: this.config.environment, release: this.config.release });
|
|
13802
13802
|
// Apply beforeSend hook if provided
|
|
13803
13803
|
if (this.config.beforeSend) {
|
|
13804
13804
|
const processed = this.config.beforeSend(payload);
|
|
@@ -13982,15 +13982,15 @@ class DevSkinSDK {
|
|
|
13982
13982
|
return;
|
|
13983
13983
|
}
|
|
13984
13984
|
const eventData = {
|
|
13985
|
-
|
|
13986
|
-
|
|
13985
|
+
eventName: eventName,
|
|
13986
|
+
eventType: 'track',
|
|
13987
13987
|
timestamp: new Date().toISOString(),
|
|
13988
|
-
|
|
13989
|
-
|
|
13990
|
-
|
|
13988
|
+
sessionId: this.sessionId,
|
|
13989
|
+
userId: this.userId || undefined,
|
|
13990
|
+
anonymousId: this.anonymousId || undefined,
|
|
13991
13991
|
properties: Object.assign(Object.assign({}, properties), this.getContextData()),
|
|
13992
|
-
|
|
13993
|
-
|
|
13992
|
+
pageUrl: window.location.href,
|
|
13993
|
+
pageTitle: document.title,
|
|
13994
13994
|
};
|
|
13995
13995
|
(_a = this.transport) === null || _a === void 0 ? void 0 : _a.sendEvent(eventData);
|
|
13996
13996
|
if ((_b = this.config) === null || _b === void 0 ? void 0 : _b.debug) {
|
|
@@ -14031,10 +14031,10 @@ class DevSkinSDK {
|
|
|
14031
14031
|
}
|
|
14032
14032
|
this.userId = userId;
|
|
14033
14033
|
const userData = {
|
|
14034
|
-
|
|
14035
|
-
|
|
14034
|
+
userId: userId,
|
|
14035
|
+
anonymousId: this.anonymousId || undefined,
|
|
14036
14036
|
traits: Object.assign(Object.assign({}, traits), this.getContextData()),
|
|
14037
|
-
|
|
14037
|
+
sessionId: this.sessionId,
|
|
14038
14038
|
timestamp: new Date().toISOString(),
|
|
14039
14039
|
};
|
|
14040
14040
|
(_a = this.transport) === null || _a === void 0 ? void 0 : _a.identifyUser(userData);
|
|
@@ -14108,7 +14108,7 @@ class DevSkinSDK {
|
|
|
14108
14108
|
// Store in sessionStorage (persists across page navigations in same tab)
|
|
14109
14109
|
sessionStorage.setItem('devskin_session_id', this.sessionId);
|
|
14110
14110
|
sessionStorage.setItem('devskin_session_start', this.sessionStartTime.toString());
|
|
14111
|
-
const sessionData = Object.assign({
|
|
14111
|
+
const sessionData = Object.assign({ sessionId: this.sessionId, userId: this.userId || undefined, anonymousId: this.anonymousId, startedAt: new Date().toISOString(), platform: 'web' }, this.getContextData());
|
|
14112
14112
|
(_b = this.transport) === null || _b === void 0 ? void 0 : _b.startSession(sessionData);
|
|
14113
14113
|
if ((_c = this.config) === null || _c === void 0 ? void 0 : _c.debug) {
|
|
14114
14114
|
console.log('[DevSkin] New session created:', this.sessionId);
|
|
@@ -14169,7 +14169,7 @@ class DevSkinSDK {
|
|
|
14169
14169
|
if (this.sessionId && this.sessionStartTime) {
|
|
14170
14170
|
const endedAt = new Date();
|
|
14171
14171
|
const durationMs = Date.now() - this.sessionStartTime;
|
|
14172
|
-
(_a = this.transport) === null || _a === void 0 ? void 0 : _a.startSession(Object.assign({
|
|
14172
|
+
(_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()));
|
|
14173
14173
|
// Clear session storage since session is ending
|
|
14174
14174
|
sessionStorage.removeItem('devskin_session_id');
|
|
14175
14175
|
sessionStorage.removeItem('devskin_session_start');
|