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.

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.

ts
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:

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:

ts
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:

json
{
  "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.

이 내용이 도움이 되었나요?

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.

이 페이지에서