@coralogix/react-native-plugin 0.3.0 → 0.3.2
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 +12 -0
- package/CxSdk.podspec +3 -3
- package/android/src/main/java/com/cxsdk/CxSdkModule.kt +1 -1
- package/index.cjs.js +5 -3
- package/index.esm.js +5 -3
- package/ios/CxSdk.swift +3 -6
- package/package.json +1 -1
- package/src/index.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## 0.3.2 (2026-03-29)
|
|
2
|
+
|
|
3
|
+
### 🩹 Patch
|
|
4
|
+
|
|
5
|
+
- Bump iOS native version to 2.4.1
|
|
6
|
+
|
|
7
|
+
## 0.3.1 (2026-03-19)
|
|
8
|
+
|
|
9
|
+
### 🩹 Fixes
|
|
10
|
+
|
|
11
|
+
- Pass `hasBeforeSend` flag to native on init so `beforeSendCallback` is set to null when not configured, avoiding an unnecessary JS round-trip for every span ([CX-35463](https://coralogix.atlassian.net/browse/CX-35463))
|
|
12
|
+
|
|
1
13
|
## 0.3.0 (2026-03-10)
|
|
2
14
|
|
|
3
15
|
### 🚀 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.
|
|
20
|
-
s.dependency 'CoralogixInternal','2.
|
|
21
|
-
s.dependency 'SessionReplay','2.
|
|
19
|
+
s.dependency 'Coralogix','2.4.1'
|
|
20
|
+
s.dependency 'CoralogixInternal','2.4.1'
|
|
21
|
+
s.dependency 'SessionReplay','2.4.1'
|
|
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.
|
|
@@ -371,7 +371,7 @@ class CxSdkModule(reactContext: ReactApplicationContext) :
|
|
|
371
371
|
traceParentInHeader = traceParentInHeaderConfig,
|
|
372
372
|
debug = if (hasKey("debug")) getBoolean("debug") else false,
|
|
373
373
|
proxyUrl = getString("proxyUrl"),
|
|
374
|
-
beforeSendCallback = ::beforeSendCallback,
|
|
374
|
+
beforeSendCallback = if (hasKey("hasBeforeSend") && getBoolean("hasBeforeSend")) ::beforeSendCallback else null,
|
|
375
375
|
collectIPData = collectIpData,
|
|
376
376
|
networkCaptureConfig = networkExtraConfig
|
|
377
377
|
)
|
package/index.cjs.js
CHANGED
|
@@ -523,7 +523,7 @@ function stopJsRefreshRateSampler() {
|
|
|
523
523
|
appStateSub = null;
|
|
524
524
|
}
|
|
525
525
|
|
|
526
|
-
var version = "0.3.
|
|
526
|
+
var version = "0.3.2";
|
|
527
527
|
var pkg = {
|
|
528
528
|
version: version};
|
|
529
529
|
|
|
@@ -888,7 +888,8 @@ const CoralogixRum = {
|
|
|
888
888
|
}
|
|
889
889
|
await CxSdk.initialize(_extends({}, finalOptions, {
|
|
890
890
|
frameworkVersion: pkg.version,
|
|
891
|
-
networkExtraConfig: finalOptions.networkExtraConfig ? serializeNetworkCaptureRules(finalOptions.networkExtraConfig) : undefined
|
|
891
|
+
networkExtraConfig: finalOptions.networkExtraConfig ? serializeNetworkCaptureRules(finalOptions.networkExtraConfig) : undefined,
|
|
892
|
+
hasBeforeSend: !!finalOptions.beforeSend
|
|
892
893
|
}));
|
|
893
894
|
isInited = true;
|
|
894
895
|
},
|
|
@@ -1187,10 +1188,11 @@ const subscription = eventEmitter.addListener('onBeforeSend', events => {
|
|
|
1187
1188
|
logger.debug('⚠️ Skipping event processing - SDK not initialized or events invalid');
|
|
1188
1189
|
return;
|
|
1189
1190
|
}
|
|
1190
|
-
|
|
1191
|
+
|
|
1191
1192
|
// Process event with beforeSendCallback if available
|
|
1192
1193
|
if (beforeSendCallback) {
|
|
1193
1194
|
try {
|
|
1195
|
+
logger.debug('🔄 Processing events with beforeSendCallback');
|
|
1194
1196
|
// Process each event in the array
|
|
1195
1197
|
const results = [];
|
|
1196
1198
|
for (const fullEvent of events) {
|
package/index.esm.js
CHANGED
|
@@ -521,7 +521,7 @@ function stopJsRefreshRateSampler() {
|
|
|
521
521
|
appStateSub = null;
|
|
522
522
|
}
|
|
523
523
|
|
|
524
|
-
var version = "0.3.
|
|
524
|
+
var version = "0.3.2";
|
|
525
525
|
var pkg = {
|
|
526
526
|
version: version};
|
|
527
527
|
|
|
@@ -886,7 +886,8 @@ const CoralogixRum = {
|
|
|
886
886
|
}
|
|
887
887
|
await CxSdk.initialize(_extends({}, finalOptions, {
|
|
888
888
|
frameworkVersion: pkg.version,
|
|
889
|
-
networkExtraConfig: finalOptions.networkExtraConfig ? serializeNetworkCaptureRules(finalOptions.networkExtraConfig) : undefined
|
|
889
|
+
networkExtraConfig: finalOptions.networkExtraConfig ? serializeNetworkCaptureRules(finalOptions.networkExtraConfig) : undefined,
|
|
890
|
+
hasBeforeSend: !!finalOptions.beforeSend
|
|
890
891
|
}));
|
|
891
892
|
isInited = true;
|
|
892
893
|
},
|
|
@@ -1185,10 +1186,11 @@ const subscription = eventEmitter.addListener('onBeforeSend', events => {
|
|
|
1185
1186
|
logger.debug('⚠️ Skipping event processing - SDK not initialized or events invalid');
|
|
1186
1187
|
return;
|
|
1187
1188
|
}
|
|
1188
|
-
|
|
1189
|
+
|
|
1189
1190
|
// Process event with beforeSendCallback if available
|
|
1190
1191
|
if (beforeSendCallback) {
|
|
1191
1192
|
try {
|
|
1193
|
+
logger.debug('🔄 Processing events with beforeSendCallback');
|
|
1192
1194
|
// Process each event in the array
|
|
1193
1195
|
const results = [];
|
|
1194
1196
|
for (const fullEvent of events) {
|
package/ios/CxSdk.swift
CHANGED
|
@@ -29,16 +29,13 @@ class CxSdk: RCTEventEmitter {
|
|
|
29
29
|
resolve:RCTPromiseResolveBlock,
|
|
30
30
|
reject:RCTPromiseRejectBlock) -> Void {
|
|
31
31
|
do {
|
|
32
|
-
|
|
33
|
-
let beforeSendCallBack: (([[String: Any]]) -> Void)? = { [weak self] (event: [[String: Any]]) -> Void in
|
|
34
|
-
// Convert the event dictionary to a format that
|
|
35
|
-
// can be safely passed to JavaScript
|
|
32
|
+
let hasBeforeSend = parameter["hasBeforeSend"] as? Bool ?? false
|
|
33
|
+
let beforeSendCallBack: (([[String: Any]]) -> Void)? = hasBeforeSend ? { [weak self] (event: [[String: Any]]) -> Void in
|
|
36
34
|
let jsEvent = event.map { (element) in
|
|
37
35
|
return self?.convertToJSCompatibleEvent(event: element)
|
|
38
36
|
}
|
|
39
|
-
|
|
40
37
|
self?.sendEvent(withName: "onBeforeSend", body: jsEvent)
|
|
41
|
-
}
|
|
38
|
+
} : nil
|
|
42
39
|
|
|
43
40
|
var options = try self.toCoralogixOptions(parameter: parameter)
|
|
44
41
|
options.beforeSendCallBack = beforeSendCallBack
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { SessionReplayOptions, SessionReplayType } from './model/SessionReplayTy
|
|
|
9
9
|
interface CxSdkClient {
|
|
10
10
|
initialize(options: CoralogixBrowserSdkConfig & {
|
|
11
11
|
frameworkVersion?: string;
|
|
12
|
+
hasBeforeSend?: boolean;
|
|
12
13
|
}): Promise<boolean>;
|
|
13
14
|
setUserContext(userContext: UserContextConfig): void;
|
|
14
15
|
getUserContext(): Promise<UserContextConfig>;
|