@coralogix/react-native-plugin 0.6.3 → 0.7.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,19 @@
1
+ ## 0.7.0 (2026-07-06)
2
+
3
+ ### 🚀 Features
4
+
5
+ - bridge createNewSession() + bump native SDKs (iOS 2.10.0 / Android 2.17.1)
6
+
7
+ ## 0.6.5 (2026-06-30)
8
+
9
+ This was a version bump only for cx-plugin to align it with other projects, there were no code changes.
10
+
11
+ ## 0.6.4 (2026-06-25)
12
+
13
+ ### 🩹 Fixes
14
+
15
+ - consume fixed native SDKs (iOS 2.9.2 / Android 2.16.2)
16
+
1
17
  ## 0.6.3 (2026-06-22)
2
18
 
3
19
  This was a version bump only for cx-plugin to align it with other projects, there were no code changes.
package/CxSdk.podspec CHANGED
@@ -16,9 +16,9 @@ Pod::Spec.new do |s|
16
16
 
17
17
  s.source_files = "ios/**/*.{h,m,mm,swift}"
18
18
 
19
- s.dependency 'Coralogix','2.9.1'
20
- s.dependency 'CoralogixInternal','2.9.1'
21
- s.dependency 'SessionReplay','2.9.1'
19
+ s.dependency 'Coralogix','2.10.0'
20
+ s.dependency 'CoralogixInternal','2.10.0'
21
+ s.dependency 'SessionReplay','2.10.0'
22
22
 
23
23
  # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
24
24
  # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
package/README.md CHANGED
@@ -118,6 +118,15 @@ Use the NavigationContainer onStateChange callback to track route changes and up
118
118
  </NavigationContainer>
119
119
  ```
120
120
 
121
+ ### Recreate Session
122
+
123
+ Recreate the RUM session on demand — for example, on user logout — so that
124
+ subsequent events belong to a fresh session with a new session id.
125
+
126
+ ```javascript
127
+ CoralogixRum.createNewSession();
128
+ ```
129
+
121
130
  ### Instrumentation's
122
131
 
123
132
  Turn on/off specific instrumentation; defaults to true for all.
@@ -84,7 +84,7 @@ dependencies {
84
84
  implementation "com.facebook.react:react-android"
85
85
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
86
86
 
87
- implementation "com.coralogix:android-sdk:2.16.1"
87
+ implementation "com.coralogix:android-sdk:2.17.1"
88
88
 
89
89
  testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
90
90
  testImplementation "org.mockito:mockito-core:5.12.0"
@@ -223,6 +223,14 @@ class CxSdkModule(reactContext: ReactApplicationContext) :
223
223
  }
224
224
  }
225
225
 
226
+ @ReactMethod
227
+ override fun createNewSession(promise: Promise) {
228
+ Handler(Looper.getMainLooper()).post {
229
+ CoralogixRum.createNewSession()
230
+ promise.resolve(true)
231
+ }
232
+ }
233
+
226
234
  @ReactMethod
227
235
  fun reportUserInteraction(interaction: ReadableMap) {
228
236
  val attributesMap = if (interaction.hasKey("attributes") && !interaction.isNull("attributes"))
@@ -24,6 +24,7 @@ interface RUMClient {
24
24
  fun reportMobileVitalsMeasurementSet(type: String, metrics: ReadableArray)
25
25
  fun isCoralogixGradlePluginApplied(promise: Promise)
26
26
  fun shutdown(promise: Promise)
27
+ fun createNewSession(promise: Promise)
27
28
 
28
29
  // custom spans
29
30
  fun startGlobalSpan(name: String, labels: ReadableMap?, ignoredInstruments: ReadableArray?, promise: Promise)
package/index.cjs.js CHANGED
@@ -537,7 +537,7 @@ function stopJsRefreshRateSampler() {
537
537
  appStateSub = null;
538
538
  }
539
539
 
540
- var version = "0.6.3";
540
+ var version = "0.7.0";
541
541
  var pkg = {
542
542
  version: version};
543
543
 
@@ -1081,6 +1081,13 @@ const CoralogixRum = {
1081
1081
  _deregisterInstrumentations = undefined;
1082
1082
  cleanupResources();
1083
1083
  },
1084
+ createNewSession: () => {
1085
+ if (!isInited) {
1086
+ logger.debug('CoralogixRum must be initiated before creating a new session');
1087
+ return;
1088
+ }
1089
+ CxSdk.createNewSession();
1090
+ },
1084
1091
  setApplicationContext: applicationContext => {
1085
1092
  if (!isInited) {
1086
1093
  logger.debug('CoralogixRum must be initiated before setting application context');
package/index.esm.js CHANGED
@@ -535,7 +535,7 @@ function stopJsRefreshRateSampler() {
535
535
  appStateSub = null;
536
536
  }
537
537
 
538
- var version = "0.6.3";
538
+ var version = "0.7.0";
539
539
  var pkg = {
540
540
  version: version};
541
541
 
@@ -1079,6 +1079,13 @@ const CoralogixRum = {
1079
1079
  _deregisterInstrumentations = undefined;
1080
1080
  cleanupResources();
1081
1081
  },
1082
+ createNewSession: () => {
1083
+ if (!isInited) {
1084
+ logger.debug('CoralogixRum must be initiated before creating a new session');
1085
+ return;
1086
+ }
1087
+ CxSdk.createNewSession();
1088
+ },
1082
1089
  setApplicationContext: applicationContext => {
1083
1090
  if (!isInited) {
1084
1091
  logger.debug('CoralogixRum must be initiated before setting application context');
package/ios/CxSdk.mm CHANGED
@@ -46,6 +46,9 @@ RCT_EXTERN_METHOD(reportUserInteraction:(NSDictionary *)interaction)
46
46
  RCT_EXTERN_METHOD(shutdown:(RCTPromiseResolveBlock)resolve
47
47
  withRejecter:(RCTPromiseRejectBlock)reject)
48
48
 
49
+ RCT_EXTERN_METHOD(createNewSession:(RCTPromiseResolveBlock)resolve
50
+ withRejecter:(RCTPromiseRejectBlock)reject)
51
+
49
52
  RCT_EXTERN_METHOD(reportError:(NSDictionary *)errorDictionary
50
53
  withResolver:(RCTPromiseResolveBlock)resolve
51
54
  withRejecter:(RCTPromiseRejectBlock)reject)
package/ios/CxSdk.swift CHANGED
@@ -214,6 +214,17 @@ class CxSdk: RCTEventEmitter {
214
214
  resolve("shutdown success")
215
215
  }
216
216
 
217
+ @objc(createNewSession:withRejecter:)
218
+ func createNewSession(resolve:RCTPromiseResolveBlock,
219
+ reject:RCTPromiseRejectBlock) -> Void {
220
+ guard let coralogixRum = coralogixRum else {
221
+ reject("CX_SDK_ERROR", "CoralogixRum must be initialized before createNewSession. Call CoralogixRum.init() first.", nil)
222
+ return
223
+ }
224
+ coralogixRum.createNewSession()
225
+ resolve(true)
226
+ }
227
+
217
228
  @objc(reportError:withResolver:withRejecter:)
218
229
  func reportError(errorDictionary:NSDictionary,
219
230
  resolve:@escaping RCTPromiseResolveBlock,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coralogix/react-native-plugin",
3
- "version": "0.6.3",
3
+ "version": "0.7.0",
4
4
  "description": "Official Coralogix React Native plugin",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Coralogix",
package/src/index.d.ts CHANGED
@@ -26,6 +26,7 @@ interface CxSdkClient {
26
26
  reportError(details: Record<string, unknown>): void;
27
27
  reportNetworkRequest(details: NetworkRequestDetails): void;
28
28
  shutdown(): Promise<boolean>;
29
+ createNewSession(): Promise<boolean>;
29
30
  sendCxSpanData(results: CxSpan[]): void;
30
31
  reportMobileVitalsMeasurement(type: string, value: number, units: string): void;
31
32
  reportMobileVitalsMeasurementSet(type: string, metrics: HybridMetric[]): void;
@@ -17,6 +17,11 @@ export interface CoralogixOtelWebType extends SendLog {
17
17
  * Turn CoralogixRum off.
18
18
  */
19
19
  shutdown: () => void;
20
+ /**
21
+ * Recreate the RUM session on demand (e.g. on user logout) so subsequent
22
+ * events belong to a fresh session.
23
+ */
24
+ createNewSession: () => void;
20
25
  /** Sets labels to be added to every log after CoralogixRum initialization. */
21
26
  setLabels: (labels: CoralogixRumLabels) => void;
22
27
  /**