DdSdkReactNativeConfiguration instance before calling DdSdkReactNative.initialize(config).
Sampling
Tracking consent
TrackingConsent controls whether data is collected and reported, for compliance requirements such as GDPR:
Event filtering and scrubbing
Event mappers run before an event is reported. Returnnull to drop the event, or return a modified event. Use them to scrub sensitive fields or remove noise.
Distributed tracing
For hosts matched byfirstPartyHosts (including subdomains), the SDK injects trace headers into XHR / fetch requests so that frontend RUM and backend APM traces are correlated. By default both the W3C traceparent and Datadog-format headers are injected; you can choose propagatorTypes per host.
Custom intake endpoints
For on-premises deployments, override the RUM and Logs intake endpoints separately throughcustomEndpoints:
WebView tracking
If your application embeds WebViews, replacereact-native-webview with the WebView exported by @flashcatcloud/mobile-react-native-webview to associate the Browser RUM events inside the WebView with the current native RUM session.
allowedHosts is the list of hosts allowed to be associated; subdomains are matched. The page loaded in the WebView must already integrate the Flashduty Browser SDK. The component is fully compatible with the props of react-native-webview.
Source map upload
JS stack traces from release builds are minified; upload source maps so the console can resolve them to source files and line numbers. The server matches source maps by service + version + bundle file name, so the service and version used at upload time must match what the SDK reports.The version reported by the SDK defaults to the application version (Android
versionName, iOS CFBundleShortVersionString) and can be overridden with config.version; if you override it, use the same value at upload time. The Metro debug ID plugin is not required.- Android
- iOS
Apply the Gradle script shipped with the package in Provide an API key with source map upload permission through an environment variable at build time:Upload behavior (from
android/app/build.gradle. It hooks into the release bundling task and calls the FlashCat CLI to upload the source map right after the bundle is built.android/app/build.gradle
0.1.1):Every JS code change produces a new bundle, so source map upload must be part of every release build; otherwise stack traces for that version stay minified. Native crashes use a separate set of symbol files — see the next section.
Native crash symbolication
Crashes in a React Native app come in two kinds, and each needs its own symbol files: JavaScript exceptions are resolved with source maps (previous section), while native crashes are captured by the underlying Android / iOS SDK and are resolved with mapping files and dSYMs.Prerequisite: turn on native crash reporting
nativeCrashReportEnabled defaults to false. While it is off, native crashes are neither reported nor flagged anywhere — the console shows nothing at all, which is indistinguishable from “no crash happened”.
The 4th to 6th positional constructor arguments are trackInteractions / trackResources / trackErrors — not this flag. Set it explicitly:
What to upload
- Android
- iOS
The React Native template leaves code shrinking off (If the app ships NDK code, the same plugin uploads the NDK symbol files as well. See Source mapping.
enableProguardInReleaseBuilds = false). With it off, Java stack traces in a release build already carry readable class and method names, so no mapping file is needed.Once you enable shrinking in android/app/build.gradle, frames turn into short names such as MainActivity.o0(SourceFile:5) and a mapping file becomes required. Upload works exactly as it does for the Android SDK — add the Flashcat Android Gradle plugin and it uploads with every release build:android/app/build.gradle