@coralogix/browser 3.22.0 → 3.23.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/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## 3.23.0 (2026-08-17)
2
+
3
+ ### 🚀 Features
4
+
5
+ - Add support for the Coralogix Product Analytics tool
6
+
7
+ ## 3.22.1 (2026-08-16)
8
+
9
+ ### 🩹 Fixes
10
+
11
+ - Report a network request under the view it started in — a request still in flight when the page changed was previously tagged with the next view's number
12
+ - Count full page loads as view changes in multi-page apps, where `view_number` previously stayed at 0 for the whole session (requires `sessionConfig.keepSessionAfterReload`)
13
+
1
14
  ## 3.22.0 (2026-08-13)
2
15
 
3
16
  ### 🚀 Features
package/README.md CHANGED
@@ -80,8 +80,6 @@
80
80
 
81
81
  38. [Flutter Web](#flutter-web)
82
82
 
83
- ---
84
-
85
83
  </details>
86
84
 
87
85
  # Official Coralogix SDK for Browsers
@@ -555,7 +553,8 @@ CoralogixRum.init({
555
553
  });
556
554
  ```
557
555
 
558
- > **Note:** Higher values may have a performance impact, as the browser needs to capture more frames each time an error is created.
556
+ > [!NOTE]
557
+ > Higher values may have a performance impact, as the browser needs to capture more frames each time an error is created.
559
558
 
560
559
  ### Mask elements
561
560
 
@@ -609,7 +608,8 @@ The SDK uses various strategies to name click actions. For more control, define
609
608
  </nav>
610
609
  ```
611
610
 
612
- > **Note:** The `data-cx-action-name` attribute is never masked, even when the element has a mask class applied. This ensures your custom action names are always captured for tracking purposes.
611
+ > [!NOTE]
612
+ > The `data-cx-action-name` attribute is never masked, even when the element has a mask class applied. This ensures your custom action names are always captured for tracking purposes.
613
613
 
614
614
  ### Label Providers
615
615
 
@@ -920,7 +920,8 @@ CoralogixRum.init({
920
920
  });
921
921
  ```
922
922
 
923
- > **Note:** The `priority` hint only works in Chromium browsers (Chrome/Edge 101+) and is a no-op elsewhere. We type this option with our own `SdkFetchPriority` alias instead of the DOM `RequestPriority` type, so it still compiles on older TypeScript versions (the SDK supports `>= 4.4.2`).
923
+ > [!NOTE]
924
+ > The `priority` hint only works in Chromium browsers (Chrome/Edge 101+) and is a no-op elsewhere. We type this option with our own `SdkFetchPriority` alias instead of the DOM `RequestPriority` type, so it still compiles on older TypeScript versions (the SDK supports `>= 4.4.2`).
924
925
 
925
926
  ### Custom Measurement
926
927
 
@@ -1109,8 +1110,6 @@ Web Worker support enables the capture of events originating from Web Workers, i
1109
1110
 
1110
1111
  > By default, Web Worker support is **disabled**.
1111
1112
 
1112
- ---
1113
-
1114
1113
  ### Enabling Web Worker Support
1115
1114
 
1116
1115
  ```javascript
@@ -1119,8 +1118,6 @@ CoralogixRum.init({
1119
1118
  });
1120
1119
  ```
1121
1120
 
1122
- ---
1123
-
1124
1121
  #### Examples
1125
1122
 
1126
1123
  ```javascript
@@ -1148,8 +1145,6 @@ self.onmessage = (message) => {
1148
1145
  };
1149
1146
  ```
1150
1147
 
1151
- ---
1152
-
1153
1148
  ## Angular Zone.js Configuration
1154
1149
 
1155
1150
  By default, the SDK runs its internal timers outside Angular's Zone.js to prevent unnecessary change detection cycles. This improves performance by avoiding redundant UI updates triggered by the SDK's background operations.
@@ -1166,9 +1161,8 @@ CoralogixRum.init({
1166
1161
  | `true` | SDK timers run outside Zone.js, preventing change detection triggers. |
1167
1162
  | `false` | SDK timers run inside Zone.js, which may trigger change detection. |
1168
1163
 
1169
- > **Note:** In most cases, you should keep the default value (`true`) for optimal performance. Only set to `false` if you have a specific reason to include SDK operations in Angular's change detection.
1170
-
1171
- ---
1164
+ > [!NOTE]
1165
+ > In most cases, you should keep the default value (`true`) for optimal performance. Only set to `false` if you have a specific reason to include SDK operations in Angular's change detection.
1172
1166
 
1173
1167
  ## CDN
1174
1168
 
package/index.esm2.js CHANGED
@@ -228,6 +228,7 @@ var SESSION_MANAGER_KEY = 'rumSessionManager';
228
228
  var SESSION_RECORDER_KEY = 'rumSessionRecorder';
229
229
  var SESSION_RECORDER_SEGMENTS_MAP = 'rumSessionRecorderSegmentsMap';
230
230
  var VIEW_NUMBER_KEY = 'rum_view_number';
231
+ var CURRENT_PAGE_FRAGMENT_KEY = 'rum_current_page_fragment';
231
232
 
232
233
  var SNAPSHOT_MANAGER_KEY = 'rumSnapshotManager';
233
234
  var SNAPSHOT_KEY = 'rum_snapshot';
@@ -3301,6 +3302,7 @@ var CoralogixAttributes = {
3301
3302
  TIMESTAMP: 'timestamp',
3302
3303
  INTERNAL: 'internal',
3303
3304
  PAGE_CONTEXT: 'page_context',
3305
+ VIEW_NUMBER: 'view_number',
3304
3306
  IS_NAVIGATION_EVENT: 'is_navigation_event',
3305
3307
  IS_DEAD_CLICK: 'is_dead_click',
3306
3308
  IS_RAGE_CLICK: 'is_rage_click',
@@ -4722,6 +4724,7 @@ var SessionManager = (function (_super) {
4722
4724
  _this.initializeSession(recordConfig);
4723
4725
  if ((_b = _this._sessionConfig) === null || _b === void 0 ? void 0 : _b.keepSessionAfterReload) {
4724
4726
  _this.loadViewNumber();
4727
+ _this.loadCurrentPageFragment();
4725
4728
  }
4726
4729
  return _this;
4727
4730
  }
@@ -4810,11 +4813,12 @@ var SessionManager = (function (_super) {
4810
4813
  });
4811
4814
  SessionManager.prototype.updateCurrentPage = function (fragment) {
4812
4815
  if (this.isIdleActive) {
4813
- this._currentPageFragment = undefined;
4816
+ this.resetCurrentPageFragment();
4814
4817
  return;
4815
4818
  }
4816
4819
  this._currentPageFragment = fragment;
4817
4820
  this._currentPageTimestamp = getNowTime();
4821
+ this.persistCurrentPageFragment(fragment);
4818
4822
  };
4819
4823
  SessionManager.prototype.incrementViewNumber = function () {
4820
4824
  this._viewNumber++;
@@ -4836,6 +4840,22 @@ var SessionManager = (function (_super) {
4836
4840
  this._viewNumber = 0;
4837
4841
  (_a = CxGlobal.sessionStorage) === null || _a === void 0 ? void 0 : _a.removeItem(VIEW_NUMBER_KEY);
4838
4842
  };
4843
+ SessionManager.prototype.persistCurrentPageFragment = function (fragment) {
4844
+ var _a, _b;
4845
+ if ((_a = this._sessionConfig) === null || _a === void 0 ? void 0 : _a.keepSessionAfterReload) {
4846
+ (_b = CxGlobal.sessionStorage) === null || _b === void 0 ? void 0 : _b.setItem(CURRENT_PAGE_FRAGMENT_KEY, fragment);
4847
+ }
4848
+ };
4849
+ SessionManager.prototype.loadCurrentPageFragment = function () {
4850
+ var _a;
4851
+ this._currentPageFragment =
4852
+ ((_a = CxGlobal.sessionStorage) === null || _a === void 0 ? void 0 : _a.getItem(CURRENT_PAGE_FRAGMENT_KEY)) || undefined;
4853
+ };
4854
+ SessionManager.prototype.resetCurrentPageFragment = function () {
4855
+ var _a;
4856
+ this._currentPageFragment = undefined;
4857
+ (_a = CxGlobal.sessionStorage) === null || _a === void 0 ? void 0 : _a.removeItem(CURRENT_PAGE_FRAGMENT_KEY);
4858
+ };
4839
4859
  SessionManager.prototype.getSessionKey = function () {
4840
4860
  return SESSION_KEY;
4841
4861
  };
@@ -4900,7 +4920,7 @@ var SessionManager = (function (_super) {
4900
4920
  (_d = getSnapshotManager()) === null || _d === void 0 ? void 0 : _d.resetSnapshot();
4901
4921
  clearStoredSnapshotState();
4902
4922
  (_e = getClickScreenshotManager()) === null || _e === void 0 ? void 0 : _e.reset();
4903
- this._currentPageFragment = undefined;
4923
+ this.resetCurrentPageFragment();
4904
4924
  this.resetViewNumber();
4905
4925
  (_f = this.sessionRecorder) === null || _f === void 0 ? void 0 : _f.stopRecording();
4906
4926
  (_g = CxGlobal.sessionStorage) === null || _g === void 0 ? void 0 : _g.removeItem(SESSION_KEY);
@@ -5176,7 +5196,7 @@ function resolveUrlBlueprinters(urlBlueprinters) {
5176
5196
  return resolvedUrlBlueprinters;
5177
5197
  }
5178
5198
 
5179
- var SDK_VERSION = '3.22.0';
5199
+ var SDK_VERSION = '3.23.0';
5180
5200
 
5181
5201
  function shouldDropEvent(cxRumEvent, options) {
5182
5202
  if (isDocumentErrorWithoutMessage(cxRumEvent)) {
@@ -5337,9 +5357,9 @@ var CoralogixSpanMapProcessor = (function () {
5337
5357
  return Promise.resolve(undefined);
5338
5358
  };
5339
5359
  CoralogixSpanMapProcessor.prototype._mapToCxSpan = function (span, session, prevSession, sessionHasRecording, sessionHasScreenshot, onlySessionWithErrorMode) {
5340
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
5341
- var _m = session || {}, sessionId = _m.sessionId, sessionCreationDate = _m.sessionCreationDate;
5342
- var _o = prevSession || {}, prevSessionId = _o.sessionId, prevSessionCreationDate = _o.sessionCreationDate, prevSessionHasRecording = _o.hasRecording, prevSessionHasScreenshot = _o.hasScreenshot;
5360
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
5361
+ var _o = session || {}, sessionId = _o.sessionId, sessionCreationDate = _o.sessionCreationDate;
5362
+ var _p = prevSession || {}, prevSessionId = _p.sessionId, prevSessionCreationDate = _p.sessionCreationDate, prevSessionHasRecording = _p.hasRecording, prevSessionHasScreenshot = _p.hasScreenshot;
5343
5363
  var attributes = span.attributes;
5344
5364
  var user_context = JSON.parse(attributes[CoralogixAttributes.USER_CONTEXT]);
5345
5365
  var application_context = JSON.parse(attributes[CoralogixAttributes.APPLICATION_CONTEXT]);
@@ -5381,14 +5401,14 @@ var CoralogixSpanMapProcessor = (function () {
5381
5401
  type: eventType,
5382
5402
  source: attributes[CoralogixAttributes.SOURCE],
5383
5403
  severity: severity,
5384
- }, labels: labels, environment: attributes[CoralogixAttributes.ENVIRONMENT] || '', view_number: getSessionManager().viewNumber, layout_context: {
5385
- viewport_width: (_c = window === null || window === void 0 ? void 0 : window.innerWidth) !== null && _c !== void 0 ? _c : 0,
5386
- viewport_height: (_d = window === null || window === void 0 ? void 0 : window.innerHeight) !== null && _d !== void 0 ? _d : 0,
5387
- view_width: (_f = (_e = document === null || document === void 0 ? void 0 : document.documentElement) === null || _e === void 0 ? void 0 : _e.scrollWidth) !== null && _f !== void 0 ? _f : 0,
5388
- view_height: (_h = (_g = document === null || document === void 0 ? void 0 : document.documentElement) === null || _g === void 0 ? void 0 : _g.scrollHeight) !== null && _h !== void 0 ? _h : 0,
5389
- device_pixel_ratio: (_j = window === null || window === void 0 ? void 0 : window.devicePixelRatio) !== null && _j !== void 0 ? _j : 1,
5390
- scroll_x: (_k = window === null || window === void 0 ? void 0 : window.scrollX) !== null && _k !== void 0 ? _k : 0,
5391
- scroll_y: (_l = window === null || window === void 0 ? void 0 : window.scrollY) !== null && _l !== void 0 ? _l : 0,
5404
+ }, labels: labels, environment: attributes[CoralogixAttributes.ENVIRONMENT] || '', view_number: (_c = span[CoralogixAttributes.VIEW_NUMBER]) !== null && _c !== void 0 ? _c : getSessionManager().viewNumber, layout_context: {
5405
+ viewport_width: (_d = window === null || window === void 0 ? void 0 : window.innerWidth) !== null && _d !== void 0 ? _d : 0,
5406
+ viewport_height: (_e = window === null || window === void 0 ? void 0 : window.innerHeight) !== null && _e !== void 0 ? _e : 0,
5407
+ view_width: (_g = (_f = document === null || document === void 0 ? void 0 : document.documentElement) === null || _f === void 0 ? void 0 : _f.scrollWidth) !== null && _g !== void 0 ? _g : 0,
5408
+ view_height: (_j = (_h = document === null || document === void 0 ? void 0 : document.documentElement) === null || _h === void 0 ? void 0 : _h.scrollHeight) !== null && _j !== void 0 ? _j : 0,
5409
+ device_pixel_ratio: (_k = window === null || window === void 0 ? void 0 : window.devicePixelRatio) !== null && _k !== void 0 ? _k : 1,
5410
+ scroll_x: (_l = window === null || window === void 0 ? void 0 : window.scrollX) !== null && _l !== void 0 ? _l : 0,
5411
+ scroll_y: (_m = window === null || window === void 0 ? void 0 : window.scrollY) !== null && _m !== void 0 ? _m : 0,
5392
5412
  } }),
5393
5413
  },
5394
5414
  };
@@ -5708,22 +5728,23 @@ var CoralogixNavigationProcessor = (function () {
5708
5728
  var pageContext = resolvePageContext(location.href);
5709
5729
  if (pageContext) {
5710
5730
  span[CoralogixAttributes.PAGE_CONTEXT] = pageContext;
5711
- var currentPageFragment = getSessionManager().currentPageFragment;
5731
+ var previousPageFragment = getSessionManager().currentPageFragment;
5712
5732
  var page_fragments = pageContext.page_fragments;
5713
- if (currentPageFragment !== page_fragments) {
5733
+ if (previousPageFragment !== page_fragments) {
5714
5734
  getSessionManager().updateCurrentPage(page_fragments);
5715
5735
  span[CoralogixAttributes.IS_NAVIGATION_EVENT] = true;
5716
- this.handlePageNavigation(currentPageFragment);
5736
+ this.handlePageNavigation(previousPageFragment);
5717
5737
  (_a = getClickScreenshotManager()) === null || _a === void 0 ? void 0 : _a.onNavigation();
5718
5738
  }
5739
+ span[CoralogixAttributes.VIEW_NUMBER] = getSessionManager().viewNumber;
5719
5740
  }
5720
5741
  }
5721
5742
  finally {
5722
5743
  this.isResolving = false;
5723
5744
  }
5724
5745
  };
5725
- CoralogixNavigationProcessor.prototype.handlePageNavigation = function (currentPageFragment) {
5726
- if (currentPageFragment) {
5746
+ CoralogixNavigationProcessor.prototype.handlePageNavigation = function (previousPageFragment) {
5747
+ if (previousPageFragment) {
5727
5748
  getSessionManager().incrementViewNumber();
5728
5749
  }
5729
5750
  };
@@ -6132,6 +6153,39 @@ var CoralogixRum = {
6132
6153
  var _a, _b;
6133
6154
  return (_b = (_a = getSessionManager()) === null || _a === void 0 ? void 0 : _a.getSession()) === null || _b === void 0 ? void 0 : _b.sessionId;
6134
6155
  },
6156
+ getResolvedName: function (element) {
6157
+ if (!isInited) {
6158
+ console.debug('CoralogixRum must be initiated before resolving element names');
6159
+ return;
6160
+ }
6161
+ try {
6162
+ return extractResolvedName({
6163
+ element: element,
6164
+ config: getSdkConfig(),
6165
+ actionName: extractActionName(element),
6166
+ ariaLabel: extractAriaLabel(element),
6167
+ });
6168
+ }
6169
+ catch (err) {
6170
+ return;
6171
+ }
6172
+ },
6173
+ getViewName: function () {
6174
+ var _a;
6175
+ if (!isInited) {
6176
+ console.debug('CoralogixRum must be initiated before resolving the view name');
6177
+ return;
6178
+ }
6179
+ try {
6180
+ return (_a = resolvePageContext(CxGlobal.location.href)) === null || _a === void 0 ? void 0 : _a.page_fragments;
6181
+ }
6182
+ catch (err) {
6183
+ return;
6184
+ }
6185
+ },
6186
+ getSdkVersion: function () {
6187
+ return SDK_VERSION;
6188
+ },
6135
6189
  createNewSession: function () {
6136
6190
  var _a;
6137
6191
  if (!isInited) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coralogix/browser",
3
- "version": "3.22.0",
3
+ "version": "3.23.0",
4
4
  "description": "Official Coralogix SDK for browsers",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Coralogix",
@@ -59,6 +59,7 @@ export declare const CoralogixAttributes: {
59
59
  TIMESTAMP: string;
60
60
  INTERNAL: string;
61
61
  PAGE_CONTEXT: string;
62
+ VIEW_NUMBER: string;
62
63
  IS_NAVIGATION_EVENT: string;
63
64
  IS_DEAD_CLICK: string;
64
65
  IS_RAGE_CLICK: string;
@@ -17,3 +17,4 @@ export declare const SESSION_MANAGER_KEY = "rumSessionManager";
17
17
  export declare const SESSION_RECORDER_KEY = "rumSessionRecorder";
18
18
  export declare const SESSION_RECORDER_SEGMENTS_MAP = "rumSessionRecorderSegmentsMap";
19
19
  export declare const VIEW_NUMBER_KEY = "rum_view_number";
20
+ export declare const CURRENT_PAGE_FRAGMENT_KEY = "rum_current_page_fragment";
@@ -32,6 +32,9 @@ export declare class SessionManager extends SessionIdle {
32
32
  private persistViewNumber;
33
33
  private loadViewNumber;
34
34
  private resetViewNumber;
35
+ private persistCurrentPageFragment;
36
+ private loadCurrentPageFragment;
37
+ private resetCurrentPageFragment;
35
38
  getSessionKey(): string;
36
39
  getActiveSession(): Session;
37
40
  start(): void;
package/src/types.d.ts CHANGED
@@ -189,6 +189,9 @@ export interface CoralogixOtelWebType extends SendLog {
189
189
  measureUserAgentSpecificMemory: () => void;
190
190
  getUserContext: () => UserContextConfig | undefined;
191
191
  getSessionId: () => string | undefined;
192
+ getResolvedName: (element: Element) => string | undefined;
193
+ getViewName: () => string | undefined;
194
+ getSdkVersion: () => string;
192
195
  createNewSession: () => void;
193
196
  stopSessionRecording: () => void;
194
197
  startSessionRecording: () => void;
package/src/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "3.22.0";
1
+ export declare const SDK_VERSION = "3.23.0";