@coralogix/react-native-plugin 0.5.0 → 0.6.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
+ ## 0.6.0 (2026-06-04)
2
+
3
+ ### 🚀 Features
4
+
5
+ - bump natives + extend reportError with optional data (0.6.0)
6
+
1
7
  ## 0.5.0 (2026-05-17)
2
8
 
3
9
  ### 🚀 Features
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.6.4'
20
- s.dependency 'CoralogixInternal','2.6.4'
21
- s.dependency 'SessionReplay','2.6.4'
19
+ s.dependency 'Coralogix','2.7.0'
20
+ s.dependency 'CoralogixInternal','2.7.0'
21
+ s.dependency 'SessionReplay','2.7.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.
@@ -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.12.0"
87
+ implementation "com.coralogix:android-sdk:2.13.0"
88
88
 
89
89
  testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
90
90
  testImplementation "org.mockito:mockito-core:5.12.0"
@@ -175,12 +175,19 @@ class CxSdkModule(reactContext: ReactApplicationContext) :
175
175
  }
176
176
  }.orEmpty()
177
177
 
178
+ val customAttributes: Map<String, Any>? = details.getMap("data")
179
+ ?.toStringAnyMap()
180
+ ?.filterValues { it != null }
181
+ ?.mapValues { it.value as Any }
182
+ ?.takeIf { it.isNotEmpty() }
183
+
178
184
  CoralogixRum.reportError(
179
185
  CoralogixErrorDecorator(
180
186
  errorType = errorType,
181
187
  errorMessage = message,
182
188
  errorStack = CoralogixStackTrace(parsedStackFrames),
183
- isCrash = isCrash
189
+ isCrash = isCrash,
190
+ customAttributes = customAttributes
184
191
  )
185
192
  )
186
193
  }
package/index.cjs.js CHANGED
@@ -537,7 +537,7 @@ function stopJsRefreshRateSampler() {
537
537
  appStateSub = null;
538
538
  }
539
539
 
540
- var version = "0.5.0";
540
+ var version = "0.6.0";
541
541
  var pkg = {
542
542
  version: version};
543
543
 
@@ -1187,7 +1187,7 @@ const CoralogixRum = {
1187
1187
  }
1188
1188
  CxSdk.endTimeMeasure(name);
1189
1189
  },
1190
- reportError: (error, isCrash) => {
1190
+ reportError: (error, isCrash, data) => {
1191
1191
  if (!isInited) {
1192
1192
  logger.debug('CoralogixRum must be initiated before error reporting');
1193
1193
  return;
@@ -1198,6 +1198,9 @@ const CoralogixRum = {
1198
1198
  stack_trace: parseErrorStack(error),
1199
1199
  is_crash: isCrash
1200
1200
  };
1201
+ if (data && Object.keys(data).length > 0) {
1202
+ errorDetails.data = data;
1203
+ }
1201
1204
  CxSdk.reportError(errorDetails);
1202
1205
  }
1203
1206
  };
package/index.esm.js CHANGED
@@ -535,7 +535,7 @@ function stopJsRefreshRateSampler() {
535
535
  appStateSub = null;
536
536
  }
537
537
 
538
- var version = "0.5.0";
538
+ var version = "0.6.0";
539
539
  var pkg = {
540
540
  version: version};
541
541
 
@@ -1185,7 +1185,7 @@ const CoralogixRum = {
1185
1185
  }
1186
1186
  CxSdk.endTimeMeasure(name);
1187
1187
  },
1188
- reportError: (error, isCrash) => {
1188
+ reportError: (error, isCrash, data) => {
1189
1189
  if (!isInited) {
1190
1190
  logger.debug('CoralogixRum must be initiated before error reporting');
1191
1191
  return;
@@ -1196,6 +1196,9 @@ const CoralogixRum = {
1196
1196
  stack_trace: parseErrorStack(error),
1197
1197
  is_crash: isCrash
1198
1198
  };
1199
+ if (data && Object.keys(data).length > 0) {
1200
+ errorDetails.data = data;
1201
+ }
1199
1202
  CxSdk.reportError(errorDetails);
1200
1203
  }
1201
1204
  };
package/ios/CxSdk.swift CHANGED
@@ -226,11 +226,15 @@ class CxSdk: RCTEventEmitter {
226
226
  let message = dictionary[Keys.errorMessage.rawValue] as? String ?? ""
227
227
  let errorType = dictionary[Keys.errorType.rawValue] as? String ?? "5"
228
228
  let isCrash = dictionary[Keys.isCrash.rawValue] as? Bool ?? false
229
+ // Pass `data` only when non-empty — an empty dict would surface
230
+ // `error_context.data = {}` on the emitted RUM event.
231
+ let customAttributes = (dictionary["data"] as? [String: Any]).flatMap { $0.isEmpty ? nil : $0 }
229
232
 
230
233
  coralogixRum?.reportError(message: message,
231
234
  stackTrace: stackTrace,
232
235
  errorType: errorType,
233
- isCrash: isCrash)
236
+ isCrash: isCrash,
237
+ customAttributes: customAttributes)
234
238
  resolve("reportError success")
235
239
  }
236
240
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coralogix/react-native-plugin",
3
- "version": "0.5.0",
3
+ "version": "0.6.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
@@ -23,7 +23,7 @@ interface CxSdkClient {
23
23
  sendCustomMeasurement(measurement: CustomMeasurement): void;
24
24
  startTimeMeasure(name: string, labels: Record<string, unknown>): void;
25
25
  endTimeMeasure(name: string): void;
26
- reportError(details: Record<string, string>): void;
26
+ reportError(details: Record<string, unknown>): void;
27
27
  reportNetworkRequest(details: NetworkRequestDetails): void;
28
28
  shutdown(): Promise<boolean>;
29
29
  sendCxSpanData(results: CxSpan[]): void;
@@ -54,7 +54,7 @@ export interface CoralogixOtelWebType extends SendLog {
54
54
  * Unknown names are dropped silently by the native SDK.
55
55
  */
56
56
  endTimeMeasure: (name: string) => void;
57
- reportError: (error: Error, isCrash: boolean) => void;
57
+ reportError: (error: Error, isCrash: boolean, data?: Record<string, unknown>) => void;
58
58
  /**
59
59
  * Report a network request to the underlying Coralogix SDK
60
60
  * @param details