@coralogix/react-native-plugin 0.2.8 → 0.2.9

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.2.9 (2026-02-11)
2
+
3
+ ### 🚀 Features
4
+
5
+ - added android support for allowedTracingUrls, bumped android native sdk to latest version 2.7.2
6
+
1
7
  ## 0.2.8 (2026-02-08)
2
8
 
3
9
  - Bump ios native version to 2.0.0
@@ -75,7 +75,7 @@ dependencies {
75
75
  implementation "com.facebook.react:react-android"
76
76
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
77
77
 
78
- implementation "com.coralogix:android-sdk:2.6.4"
78
+ implementation "com.coralogix:android-sdk:2.7.2"
79
79
  }
80
80
 
81
81
  react {
@@ -16,6 +16,8 @@ import com.coralogix.android.sdk.model.Framework
16
16
  import com.coralogix.android.sdk.model.HybridMetric
17
17
  import com.coralogix.android.sdk.model.Instrumentation
18
18
  import com.coralogix.android.sdk.model.MobileVitalType
19
+ import com.coralogix.android.sdk.model.TraceParentInHeaderConfig
20
+ import com.coralogix.android.sdk.model.TraceParentInHeaderConfigOptions
19
21
  import com.coralogix.android.sdk.model.UserContext
20
22
  import com.coralogix.android.sdk.model.ViewContext
21
23
  import com.coralogix.android.sdk.session_replay.SessionReplay
@@ -34,7 +36,6 @@ import com.facebook.react.bridge.WritableMap
34
36
  import com.facebook.react.modules.core.DeviceEventManagerModule
35
37
  import org.json.JSONArray
36
38
  import org.json.JSONObject
37
- import java.lang.Long.getLong
38
39
  import com.facebook.react.uimanager.UIManagerModule
39
40
 
40
41
  class CxSdkModule(reactContext: ReactApplicationContext) :
@@ -308,9 +309,22 @@ class CxSdkModule(reactContext: ReactApplicationContext) :
308
309
  ?: throw IllegalArgumentException("Missing required parameter: coralogixDomain")
309
310
 
310
311
  val traceParentInHeaderMap = getMap("traceParentInHeader")
311
- val isTraceParentInHeaderEnabled = traceParentInHeaderMap?.let {
312
- it.hasKey("enabled") && it.getBoolean("enabled")
313
- } ?: false
312
+
313
+ val allowedTracingUrls = traceParentInHeaderMap
314
+ ?.getMap("options")
315
+ ?.getArray("allowedTracingUrls")
316
+ ?.toStringList()
317
+ ?: emptyList()
318
+
319
+ val traceParentInHeaderConfig = traceParentInHeaderMap?.let {
320
+ TraceParentInHeaderConfig(
321
+ enabled = if (it.hasKey("enabled")) it.getBoolean("enabled") else false,
322
+ options = TraceParentInHeaderConfigOptions(
323
+ allowedTracingUrls = allowedTracingUrls
324
+ )
325
+ )
326
+ } ?: TraceParentInHeaderConfig()
327
+
314
328
  val collectIpData = if (hasKey("collectIPData")) getBoolean("collectIPData") else true
315
329
 
316
330
  return CoralogixOptions(
@@ -327,7 +341,7 @@ class CxSdkModule(reactContext: ReactApplicationContext) :
327
341
  ignoreUrls = getArray("ignoreUrls")?.handleStringOrRegexList() ?: listOf(),
328
342
  ignoreErrors = getArray("ignoreErrors")?.handleStringOrRegexList() ?: listOf(),
329
343
  sessionSampleRate = 100,
330
- traceParentInHeader = isTraceParentInHeaderEnabled,
344
+ traceParentInHeader = traceParentInHeaderConfig,
331
345
  debug = if (hasKey("debug")) getBoolean("debug") else false,
332
346
  proxyUrl = getString("proxyUrl"),
333
347
  beforeSendCallback = ::beforeSendCallback,
@@ -573,6 +587,26 @@ class CxSdkModule(reactContext: ReactApplicationContext) :
573
587
  return result
574
588
  }
575
589
 
590
+ private fun ReadableArray?.toStringList(): List<String> {
591
+ if (this == null) return emptyList()
592
+
593
+ return try {
594
+ val result = mutableListOf<String>()
595
+
596
+ for (i in 0 until size()) {
597
+ if (getType(i) == ReadableType.String) {
598
+ result.add(getString(i))
599
+ } else {
600
+ Log.w("CxSdkModule", "Value at $i in ReadableArray is of type ${getType(i)}, expecting String, skipping value")
601
+ }
602
+ }
603
+
604
+ result
605
+ } catch (_: Exception) {
606
+ emptyList()
607
+ }
608
+ }
609
+
576
610
  private fun ReadableMap.toJsonObject(): JSONObject {
577
611
  val obj = JSONObject()
578
612
  val iterator = keySetIterator()
package/index.cjs.js CHANGED
@@ -220,7 +220,7 @@ function stopJsRefreshRateSampler() {
220
220
  appStateSub = null;
221
221
  }
222
222
 
223
- var version = "0.2.8";
223
+ var version = "0.2.9";
224
224
  var pkg = {
225
225
  version: version};
226
226
 
package/index.esm.js CHANGED
@@ -218,7 +218,7 @@ function stopJsRefreshRateSampler() {
218
218
  appStateSub = null;
219
219
  }
220
220
 
221
- var version = "0.2.8";
221
+ var version = "0.2.9";
222
222
  var pkg = {
223
223
  version: version};
224
224
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coralogix/react-native-plugin",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "Official Coralogix React Native plugin",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Coralogix",