Verify Unified SDK for React Native events
The Unified SDK for React Native sends analytics events through the bundled React Native SDK. An analytics event moves through the same four stages as in the React Native SDK: captured, transformed, sent, and received. This page covers the checks specific to the Unified SDK, starting with initialization, and links to the React Native SDK steps for the other stages.
| Stage | Question | Where to look |
|---|---|---|
| Initialized | Did init() set up every product you use? | The Failed to initialize log lines and the accessors |
| Captured | Did the SDK accept the call? | Debug logs |
| Transformed | What did plugins add, change, or drop? | An inspection plugin |
| Sent | Did the request leave the device, and with what payload? | The final-event log line, a proxy, or a custom transport |
| Received | Did Amplitude accept and store the event? | The upload result and User Lookup |
For problems common to every Amplitude SDK, go to SDK troubleshooting and debugging. For changes between versions, go to the @amplitude/unified-react-native changelog.
Turn on debug logging
Set logLevel at the top level. The SDK passes it to Analytics, Session Replay, and Guides and Surveys.
await amplitude.init("AMPLITUDE_API_KEY", {
logLevel: amplitude.Types.LogLevel.Debug,
});
A logLevel inside a product's options overrides the top-level value for that product. For log levels and what each message contains, go to Turn on debug logging in the React Native SDK. Return logLevel to Warn before you ship.
Check that each product initialized
init() doesn't throw. When a product fails, the SDK logs an error through the analytics logger and moves on:
| Log message | Meaning |
|---|---|
Failed to initialize Analytics. | Analytics failed. The SDK skipped every other product. |
Failed to initialize Experiment. followed by the error, such as Flags error response: status=401 | The Experiment client couldn't start, often because of the deployment key. experiment() still returns the client. |
Failed to initialize Session Replay. followed by The package '@amplitude/plugin-session-replay-react-native' doesn't seem to be linked. | The native module isn't linked. sessionReplay() returns undefined. |
Failed to initialize Guides and Surveys. | The Guides and Surveys plugin or its boot step failed. |
Errors log at the Error level, so they appear unless logLevel is None. If you pass a custom analytics.loggerProvider, the errors go to that logger.
After init() resolves, check the accessors:
await amplitude.init("AMPLITUDE_API_KEY", {
sessionReplay: { sampleRate: 1 },
});
console.log(await amplitude.sessionReplay()?.getSessionReplayProperties());
// { "[Amplitude] Session Replay ID": "..." } while recording
console.log(typeof amplitude.experiment()?.fetch);
// "function"
Both accessors return undefined before init() finishes. sessionReplay() also returns undefined when Session Replay failed to install.
Check what the SDK sent
To find requests and the payload shape, go to Check what the SDK sent in the React Native SDK. The library field of each Unified SDK event contains two version numbers:
{
"event_type": "Sign Up Clicked",
"library": "amplitude-ts-unified-react-native/<UNIFIED_VERSION>-amplitude-react-native-ts/<ANALYTICS_VERSION>"
}
<UNIFIED_VERSION> is the @amplitude/unified-react-native version, such as 1.0.0-beta.11. <ANALYTICS_VERSION> is the bundled React Native SDK version, such as 1.13.0. Use the second version when you compare behavior against the React Native SDK release notes.
Was this helpful?
For AI agents: a documentation index is available at /docs/llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.