React Native

How the React Native SDK sits on top of the Android and Apple SDKs, which packages it is made of, and the order to read these pages in.

The Sophonz React Native SDK is a set of bindings over the Sophonz Android SDK and Apple SDK. JavaScript errors, logs, network requests and spans cross a native module into those SDKs, so they share one session, one device identity and one delivery path with everything the native SDKs capture on their own.

How it fits together

There is no telemetry pipeline in JavaScript. When your code calls logError or ends a span, the call goes over the React Native bridge and the native SDK records it. Storage, retries, crash resurrection and the conversion to OTLP all happen natively, and the collector receives OTLP/JSON from the device exactly as it would from a native app.

That has three consequences worth knowing before you start:

  • Configuration is native. Android reads its collector URL and app key from sophonz-config.json at build time. iOS takes them from JavaScript, Sophonz-Info.plist or native code. A missing key is a native problem, and nothing in JavaScript will report it.
  • Native capture comes for free. Crashes, ANRs, network requests made by fetch and XMLHttpRequest, and app lifecycle are captured by the native SDKs whether or not JavaScript ever calls anything.
  • Whoever starts the SDK first configures it. If the SDK is started in MainApplication or the AppDelegate, the options passed to initialize in JavaScript are ignored without a warning.

Packages

PackageWhat it does
@sophonz/react-nativeStarts the SDK, installs the global JS error handler, logs, breadcrumbs, sessions, users, manual network recording. Includes the Expo config plugin and the setup wizard
@sophonz/react-native-tracer-providerAn OpenTelemetry TracerProvider whose spans are recorded by the native SDKs
@sophonz/react-native-navigationScreen spans for expo-router, React Navigation and react-native-navigation
@sophonz/react-native-reduxA span per dispatched Redux action
@sophonz/react-native-otlpAdditional OTLP/HTTP exporters, for sending the same telemetry to a second backend

Only the first is required. The navigation and Redux packages need the tracer provider.

Versions

ComponentVersionSource
@sophonz/* React Native packages0.1.0npm
Sophonz Android SDK1.0.0GitHub Packages (credentials required)
Sophonz Apple SDK (SophonzIO)1.0.0git tag v1.0.0 of sophonz-apple-sdk

All five npm packages are released together and share a version. The native versions are pinned by the React Native packages; you do not choose them separately.

Reading order

  1. Installation — packages, native SDK access, Expo, bare React Native, starting the SDK
  2. Configuration — where the collector URL and app key live on each platform, and every option
  3. Instrumentation — what is captured without code, and what each package adds
  4. Networking and distributed tracing — request capture, traceparent, joining backend traces
  5. Navigation — screen spans for expo-router, React Navigation and react-native-navigation
  6. Redux — the action middleware and what it records
  7. OpenTelemetry and OTLP — custom spans with the OpenTelemetry API, extra exporters
  8. API reference — every export and where the two platforms differ
  9. Release builds and symbolication — JS bundles, R8 mappings and dSYMs
  10. Examples — a complete start sequence and common patterns

TIP — This is just the beginning

Now ship your app. Sophonz surfaces the problems real users hit — so your app evolves on its own.