@corbado/observe 1.9.1 → 1.10.0
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/analysis/client.mjs +183 -4
- package/dist/analysis/config.mjs +4 -1
- package/dist/analysis/cross-origin-session.mjs +422 -0
- package/dist/analysis/queue.mjs +9 -0
- package/dist/analysis/readers/page.mjs +4 -0
- package/dist/analysis/version.mjs +1 -1
- package/dist/cdn/script.global.js +4 -4
- package/dist/index.d.mts +125 -3
- package/dist/index.d.ts +125 -3
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/package.json +1 -1
package/dist/analysis/queue.mjs
CHANGED
|
@@ -37,6 +37,7 @@ var RequestQueue = class {
|
|
|
37
37
|
this.requestConfig = options.requestConfig ?? true;
|
|
38
38
|
this.onConfigReceived = options.onConfigReceived;
|
|
39
39
|
this.getDataPolicy = options.getDataPolicy;
|
|
40
|
+
this.getCrossOriginSession = options.getCrossOriginSession;
|
|
40
41
|
this.fixedData = options.fixedData === true;
|
|
41
42
|
this.beforeEventBatchSend = options.beforeEventBatchSend;
|
|
42
43
|
this.standaloneDeviceInfo = options.standaloneDeviceInfo;
|
|
@@ -105,6 +106,7 @@ var RequestQueue = class {
|
|
|
105
106
|
requestConfig;
|
|
106
107
|
onConfigReceived;
|
|
107
108
|
getDataPolicy;
|
|
109
|
+
getCrossOriginSession;
|
|
108
110
|
fixedData;
|
|
109
111
|
beforeEventBatchSend;
|
|
110
112
|
standaloneDeviceInfo;
|
|
@@ -487,6 +489,13 @@ var RequestQueue = class {
|
|
|
487
489
|
if (this.fixedData) {
|
|
488
490
|
batch.meta = { ...batch.meta, fixedData: true };
|
|
489
491
|
}
|
|
492
|
+
try {
|
|
493
|
+
const crossOriginSession = this.getCrossOriginSession?.(batch.sessionId);
|
|
494
|
+
if (crossOriginSession) {
|
|
495
|
+
batch.meta = { ...batch.meta, crossOriginSession };
|
|
496
|
+
}
|
|
497
|
+
} catch {
|
|
498
|
+
}
|
|
490
499
|
const retryCount = entries.reduce((max, entry) => Math.max(max, entry.attempts), 0);
|
|
491
500
|
if (retryCount > 0) {
|
|
492
501
|
batch.meta = { ...batch.meta, retryCount };
|
|
@@ -21,8 +21,12 @@ function readSourcePath(_meta, mode, allow) {
|
|
|
21
21
|
const search = applySourcePathQuery(window.location.search, mode, allow);
|
|
22
22
|
return `${window.location.pathname}${search}`;
|
|
23
23
|
}
|
|
24
|
+
function readCookieScope(_meta) {
|
|
25
|
+
return { hostname: window.location.hostname, https: window.location.protocol === "https:" };
|
|
26
|
+
}
|
|
24
27
|
export {
|
|
25
28
|
listenWindow,
|
|
29
|
+
readCookieScope,
|
|
26
30
|
readDocumentComplete,
|
|
27
31
|
readDocumentHidden,
|
|
28
32
|
readPageUrl,
|