@coralogix/browser 3.18.0 β†’ 3.19.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,9 @@
1
+ ## 3.19.0 (2026-07-12)
2
+
3
+ ### πŸš€ Features
4
+
5
+ - Add `createNewSession()` API to manually rotate the session (e.g. on user logout)
6
+
1
7
  ## 3.18.0 (2026-07-08)
2
8
 
3
9
  ### πŸš€ Features
package/README.md CHANGED
@@ -22,17 +22,18 @@
22
22
  - [Worker URL](#worker-url)
23
23
  - [Screenshots](#screenshots)
24
24
 
25
- 10. [Unique Users](#unique-users)
26
- 11. [Network Extra Configuration](#network-extra-configuration)
27
- 12. [Multi Page Application](#multi-page-application)
28
- 13. [Ignore Errors](#ignore-errors)
29
- 14. [Ignore URLs](#ignore-urls)
30
- 15. [Stack Trace Limit](#stack-trace-limit)
31
- 16. [Mask Elements](#mask-elements)
32
- 17. [Custom Action Names](#custom-action-names)
33
- 18. [Label Providers](#label-providers)
34
- 19. [URL Blueprinters](#url-blueprinters)
35
- 20. [Traces](#traces)
25
+ 10. [Manually Create a New Session](#manually-create-a-new-session)
26
+ 11. [Unique Users](#unique-users)
27
+ 12. [Network Extra Configuration](#network-extra-configuration)
28
+ 13. [Multi Page Application](#multi-page-application)
29
+ 14. [Ignore Errors](#ignore-errors)
30
+ 15. [Ignore URLs](#ignore-urls)
31
+ 16. [Stack Trace Limit](#stack-trace-limit)
32
+ 17. [Mask Elements](#mask-elements)
33
+ 18. [Custom Action Names](#custom-action-names)
34
+ 19. [Label Providers](#label-providers)
35
+ 20. [URL Blueprinters](#url-blueprinters)
36
+ 21. [Traces](#traces)
36
37
 
37
38
  - [Propagate Trace Header for CORS URLs](#propagatetraceheadercorsurls)
38
39
  - [Allowed Tracing URLs](#allowedtracingurls)
@@ -40,34 +41,34 @@
40
41
  - [Custom Propagation](#custom-propagation)
41
42
  - [Traces Exporter](#traces-exporter)
42
43
 
43
- 21. [Before Send](#before-send)
44
- 22. [Proxy URL](#proxy-url)
44
+ 22. [Before Send](#before-send)
45
+ 23. [Proxy URL](#proxy-url)
45
46
 
46
47
  - [ignoreProxyUrlParams](#ignoreproxyurlparams)
47
48
 
48
- 23. [Collect IP Data](#collect-ip-data)
49
- 24. [SDK Fetch Priority](#sdk-fetch-priority)
50
- 25. [Custom Measurement](#custom-measurement)
51
- 26. [Add Timing](#add-timing)
52
- 27. [Custom Time Measurement](#custom-time-measurement)
53
- 28. [Microfrontend Support](#microfrontend-support)
49
+ 24. [Collect IP Data](#collect-ip-data)
50
+ 25. [SDK Fetch Priority](#sdk-fetch-priority)
51
+ 26. [Custom Measurement](#custom-measurement)
52
+ 27. [Add Timing](#add-timing)
53
+ 28. [Custom Time Measurement](#custom-time-measurement)
54
+ 29. [Microfrontend Support](#microfrontend-support)
54
55
 
55
56
  - [Pre Requisites](#pre-requisites)
56
57
 
57
- 29. [Custom Spans](#custom-spans)
58
+ 30. [Custom Spans](#custom-spans)
58
59
 
59
60
  - [Ignored Instruments](#ignored-instruments)
60
61
 
61
- 30. [OpenTelemetry Batch Configuration](#opentelemetry-batch-configuration)
62
- 31. [Soft Navigations (Experimental)](#soft-navigations--experimental)
63
- 32. [Memory Usage (Experimental)](#memory-usage---experimental)
64
- 33. [Web Worker Support](#web-worker-support)
62
+ 31. [OpenTelemetry Batch Configuration](#opentelemetry-batch-configuration)
63
+ 32. [Soft Navigations (Experimental)](#soft-navigations--experimental)
64
+ 33. [Memory Usage (Experimental)](#memory-usage---experimental)
65
+ 34. [Web Worker Support](#web-worker-support)
65
66
 
66
67
  - [Enabling Web Worker Support](#enabling-web-worker-support)
67
68
  - [Examples](#examples)
68
69
 
69
- 34. [Angular Zone.js Configuration](#angular-zonejs-configuration)
70
- 35. [CDN](#cdn)
70
+ 35. [Angular Zone.js Configuration](#angular-zonejs-configuration)
71
+ 36. [CDN](#cdn)
71
72
 
72
73
  - [Specific Version](#specific-version-recommended)
73
74
  - [ES5](#es5)
@@ -76,7 +77,7 @@
76
77
  - [Via JS File](#via-js-file)
77
78
  - [Via TS File](#via-ts-file)
78
79
 
79
- 36. [Flutter Web](#flutter-web)
80
+ 37. [Flutter Web](#flutter-web)
80
81
 
81
82
  ---
82
83
 
@@ -454,6 +455,19 @@ CoralogixRum.init({
454
455
  });
455
456
  ```
456
457
 
458
+ ### Manually Create a New Session
459
+
460
+ By default the SDK rotates the session automatically β€” after 15 minutes of inactivity, or once a session reaches 1 hour. Starting with version `3.19.0`, you can also rotate it on demand by calling `CoralogixRum.createNewSession()`, for example when a user logs out, so that subsequent events are attributed to a fresh session.
461
+
462
+ ```javascript
463
+ import { CoralogixRum } from '@coralogix/browser';
464
+
465
+ // e.g. inside your logout handler
466
+ CoralogixRum.createNewSession();
467
+ ```
468
+
469
+ This ends the current session and immediately starts a new one with a new session id. If session recording is active, the current recording is finalized and a new one begins for the new session.
470
+
457
471
  ### Unique Users
458
472
 
459
473
  Starting with version `2.9.0`, the SDK calculates unique users based on the user’s `fingerprint`.<br>
package/index.esm2.js CHANGED
@@ -4568,6 +4568,10 @@ var SessionManager = (function (_super) {
4568
4568
  _this._currentPageTimestamp = getNowTime();
4569
4569
  _this._viewNumber = 0;
4570
4570
  _this.debugMode = !!((_a = getSdkConfig()) === null || _a === void 0 ? void 0 : _a.debug);
4571
+ _this.recreateSession = function () {
4572
+ _this.clearSessionWhenIdle();
4573
+ return _this.setSession(true);
4574
+ };
4571
4575
  _this.getPrevSession = function () {
4572
4576
  var _a;
4573
4577
  return JSON.parse((_a = CxGlobal.sessionStorage) === null || _a === void 0 ? void 0 : _a.getItem(PREV_SESSION_KEY));
@@ -5035,7 +5039,7 @@ function resolveUrlBlueprinters(urlBlueprinters) {
5035
5039
  return resolvedUrlBlueprinters;
5036
5040
  }
5037
5041
 
5038
- var SDK_VERSION = '3.18.0';
5042
+ var SDK_VERSION = '3.19.0';
5039
5043
 
5040
5044
  function shouldDropEvent(cxRumEvent, options) {
5041
5045
  if (isDocumentErrorWithoutMessage(cxRumEvent)) {
@@ -5990,6 +5994,14 @@ var CoralogixRum = {
5990
5994
  var _a, _b;
5991
5995
  return (_b = (_a = getSessionManager()) === null || _a === void 0 ? void 0 : _a.getSession()) === null || _b === void 0 ? void 0 : _b.sessionId;
5992
5996
  },
5997
+ createNewSession: function () {
5998
+ var _a;
5999
+ if (!isInited) {
6000
+ console.debug('CoralogixRum must be initiated before creating a new session');
6001
+ return;
6002
+ }
6003
+ (_a = getSessionManager()) === null || _a === void 0 ? void 0 : _a.recreateSession();
6004
+ },
5993
6005
  log: function (severity, message, data, labels) {
5994
6006
  if (!isInited) {
5995
6007
  console.debug('CoralogixRum must be initiated before using log');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coralogix/browser",
3
- "version": "3.18.0",
3
+ "version": "3.19.0",
4
4
  "description": "Official Coralogix SDK for browsers",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Coralogix",
@@ -36,6 +36,7 @@ export declare class SessionManager extends SessionIdle {
36
36
  getActiveSession(): Session;
37
37
  start(): void;
38
38
  stop(): void;
39
+ recreateSession: () => Session;
39
40
  getPrevSession: () => PrevSession;
40
41
  getSession: () => Session;
41
42
  private initializeSession;
package/src/types.d.ts CHANGED
@@ -186,6 +186,7 @@ export interface CoralogixOtelWebType extends SendLog {
186
186
  measureUserAgentSpecificMemory: () => void;
187
187
  getUserContext: () => UserContextConfig | undefined;
188
188
  getSessionId: () => string | undefined;
189
+ createNewSession: () => void;
189
190
  stopSessionRecording: () => void;
190
191
  startSessionRecording: () => void;
191
192
  screenshot: (description?: string) => string | undefined;
package/src/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "3.18.0";
1
+ export declare const SDK_VERSION = "3.19.0";