@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.
@@ -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,
@@ -1,6 +1,6 @@
1
1
  // src/version.ts
2
2
  var SDK_NAME = "@corbado/observe";
3
- var SDK_VERSION = true ? "1.9.1" : "0.0.0-dev";
3
+ var SDK_VERSION = true ? "1.10.0" : "0.0.0-dev";
4
4
  export {
5
5
  SDK_NAME,
6
6
  SDK_VERSION