@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.esm.js
CHANGED
|
@@ -511,7 +511,7 @@ class ErrorCollector {
|
|
|
511
511
|
stack: error.stack,
|
|
512
512
|
type: error.name || 'Error',
|
|
513
513
|
timestamp: new Date().toISOString(),
|
|
514
|
-
|
|
514
|
+
sessionId: '', // Will be set by transport
|
|
515
515
|
url: window.location.href,
|
|
516
516
|
breadcrumbs: [...this.breadcrumbs],
|
|
517
517
|
context: Object.assign(Object.assign({}, context), { userAgent: navigator.userAgent, viewport: {
|
|
@@ -534,7 +534,7 @@ class ErrorCollector {
|
|
|
534
534
|
message: String(error),
|
|
535
535
|
type: 'Error',
|
|
536
536
|
timestamp: new Date().toISOString(),
|
|
537
|
-
|
|
537
|
+
sessionId: '',
|
|
538
538
|
url: window.location.href,
|
|
539
539
|
breadcrumbs: [...this.breadcrumbs],
|
|
540
540
|
context,
|
|
@@ -13744,7 +13744,7 @@ class Transport {
|
|
|
13744
13744
|
sendToBackendXHR(endpoint, data) {
|
|
13745
13745
|
return __awaiter$1(this, void 0, void 0, function* () {
|
|
13746
13746
|
const url = `${this.apiUrl}${endpoint}`;
|
|
13747
|
-
const payload = Object.assign(Object.assign({}, data), { apiKey: this.config.apiKey,
|
|
13747
|
+
const payload = Object.assign(Object.assign({}, data), { apiKey: this.config.apiKey, applicationId: this.config.appId, environment: this.config.environment, release: this.config.release });
|
|
13748
13748
|
// Apply beforeSend hook if provided
|
|
13749
13749
|
if (this.config.beforeSend) {
|
|
13750
13750
|
const processed = this.config.beforeSend(payload);
|
|
@@ -13794,7 +13794,7 @@ class Transport {
|
|
|
13794
13794
|
sendToBackend(endpoint_1, data_1) {
|
|
13795
13795
|
return __awaiter$1(this, arguments, void 0, function* (endpoint, data, useBeacon = false) {
|
|
13796
13796
|
const url = `${this.apiUrl}${endpoint}`;
|
|
13797
|
-
const payload = Object.assign(Object.assign({}, data), { apiKey: this.config.apiKey,
|
|
13797
|
+
const payload = Object.assign(Object.assign({}, data), { apiKey: this.config.apiKey, applicationId: this.config.appId, environment: this.config.environment, release: this.config.release });
|
|
13798
13798
|
// Apply beforeSend hook if provided
|
|
13799
13799
|
if (this.config.beforeSend) {
|
|
13800
13800
|
const processed = this.config.beforeSend(payload);
|
|
@@ -13978,15 +13978,15 @@ class DevSkinSDK {
|
|
|
13978
13978
|
return;
|
|
13979
13979
|
}
|
|
13980
13980
|
const eventData = {
|
|
13981
|
-
|
|
13982
|
-
|
|
13981
|
+
eventName: eventName,
|
|
13982
|
+
eventType: 'track',
|
|
13983
13983
|
timestamp: new Date().toISOString(),
|
|
13984
|
-
|
|
13985
|
-
|
|
13986
|
-
|
|
13984
|
+
sessionId: this.sessionId,
|
|
13985
|
+
userId: this.userId || undefined,
|
|
13986
|
+
anonymousId: this.anonymousId || undefined,
|
|
13987
13987
|
properties: Object.assign(Object.assign({}, properties), this.getContextData()),
|
|
13988
|
-
|
|
13989
|
-
|
|
13988
|
+
pageUrl: window.location.href,
|
|
13989
|
+
pageTitle: document.title,
|
|
13990
13990
|
};
|
|
13991
13991
|
(_a = this.transport) === null || _a === void 0 ? void 0 : _a.sendEvent(eventData);
|
|
13992
13992
|
if ((_b = this.config) === null || _b === void 0 ? void 0 : _b.debug) {
|
|
@@ -14027,10 +14027,10 @@ class DevSkinSDK {
|
|
|
14027
14027
|
}
|
|
14028
14028
|
this.userId = userId;
|
|
14029
14029
|
const userData = {
|
|
14030
|
-
|
|
14031
|
-
|
|
14030
|
+
userId: userId,
|
|
14031
|
+
anonymousId: this.anonymousId || undefined,
|
|
14032
14032
|
traits: Object.assign(Object.assign({}, traits), this.getContextData()),
|
|
14033
|
-
|
|
14033
|
+
sessionId: this.sessionId,
|
|
14034
14034
|
timestamp: new Date().toISOString(),
|
|
14035
14035
|
};
|
|
14036
14036
|
(_a = this.transport) === null || _a === void 0 ? void 0 : _a.identifyUser(userData);
|
|
@@ -14104,7 +14104,7 @@ class DevSkinSDK {
|
|
|
14104
14104
|
// Store in sessionStorage (persists across page navigations in same tab)
|
|
14105
14105
|
sessionStorage.setItem('devskin_session_id', this.sessionId);
|
|
14106
14106
|
sessionStorage.setItem('devskin_session_start', this.sessionStartTime.toString());
|
|
14107
|
-
const sessionData = Object.assign({
|
|
14107
|
+
const sessionData = Object.assign({ sessionId: this.sessionId, userId: this.userId || undefined, anonymousId: this.anonymousId, startedAt: new Date().toISOString(), platform: 'web' }, this.getContextData());
|
|
14108
14108
|
(_b = this.transport) === null || _b === void 0 ? void 0 : _b.startSession(sessionData);
|
|
14109
14109
|
if ((_c = this.config) === null || _c === void 0 ? void 0 : _c.debug) {
|
|
14110
14110
|
console.log('[DevSkin] New session created:', this.sessionId);
|
|
@@ -14165,7 +14165,7 @@ class DevSkinSDK {
|
|
|
14165
14165
|
if (this.sessionId && this.sessionStartTime) {
|
|
14166
14166
|
const endedAt = new Date();
|
|
14167
14167
|
const durationMs = Date.now() - this.sessionStartTime;
|
|
14168
|
-
(_a = this.transport) === null || _a === void 0 ? void 0 : _a.startSession(Object.assign({
|
|
14168
|
+
(_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()));
|
|
14169
14169
|
// Clear session storage since session is ending
|
|
14170
14170
|
sessionStorage.removeItem('devskin_session_id');
|
|
14171
14171
|
sessionStorage.removeItem('devskin_session_start');
|