Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

docs(onboarding): document React Native native crash autocapture (#63226)

Ioannis J4f83d520a2e0
diff --git a/docs/onboarding/error-tracking/react-native.tsx b/docs/onboarding/error-tracking/react-native.tsx
index 2cd90f30a22a..ca5982a1f89e 100644
--- a/docs/onboarding/error-tracking/react-native.tsx
+++ b/docs/onboarding/error-tracking/react-native.tsx
@@ -39,6 +39,7 @@ export const getReactNativeSteps = (ctx: OnboardingComponentsContext): StepDefin
uncaughtExceptions: true,
unhandledRejections: true,
console: ['error', 'warn'],
+ nativeCrashes: true, // native iOS/Android crashes (see below)
},
},
})
@@ -55,8 +56,20 @@ export const getReactNativeSteps = (ctx: OnboardingComponentsContext): StepDefin
| \`uncaughtExceptions\` | Captures Uncaught exceptions (\`ReactNativeGlobal.ErrorUtils.setGlobalHandler\`) |
| \`unhandledRejections\` | Captures Unhandled rejections (\`ReactNativeGlobal.onunhandledrejection\`) |
| \`console\` | Captures console logs as errors according to the reported \`LogLevel\` |
+ | \`nativeCrashes\` | Captures native iOS/Android crashes. Requires \`@posthog/react-native-plugin\` and uploaded native symbols (see below) |
`}
</Markdown>
+ <CalloutBox type="fyi" title="Capturing native crashes">
+ <Markdown>
+ {dedent`
+ \`nativeCrashes\` captures native iOS and Android crashes that the JavaScript layer can't see. Beyond the config above, it needs:
+
+ 1. The optional native plugin installed — \`npx expo install @posthog/react-native-plugin\` (Expo) or \`npm i @posthog/react-native-plugin\` (bare React Native). If it's missing, native capture is a no-op and your JS-level autocapture is unaffected.
+ 2. Your project's **Enable exception autocapture** setting enabled in [error tracking settings](https://app.posthog.com/settings/project-error-tracking#exception-autocapture) — the same server-side setting that gates JavaScript autocapture.
+ 3. Native debug symbols uploaded at build time, so crash stack traces are readable. See [native crash symbolication](https://posthog.com/docs/error-tracking/upload-source-maps/react-native#native-crash-symbolication).
+ `}
+ </Markdown>
+ </CalloutBox>
</>
),
}
@@ -181,10 +194,9 @@ export const getReactNativeSteps = (ctx: OnboardingComponentsContext): StepDefin
{dedent`
We currently don't support the following features:
- - No native Android and iOS exception capture
- No automatic source map uploads on React Native web
- These features will be added in future releases. We recommend you stay up to date with the latest version of the PostHog React Native SDK.
+ This will be added in a future release. We recommend you stay up to date with the latest version of the PostHog React Native SDK.
`}
</Markdown>
),
diff --git a/docs/onboarding/session-replay/react-native.tsx b/docs/onboarding/session-replay/react-native.tsx
index f3aef09e7b2f..f2db842672f2 100644
--- a/docs/onboarding/session-replay/react-native.tsx
+++ b/docs/onboarding/session-replay/react-native.tsx
@@ -21,14 +21,14 @@ export const getReactNativeSteps = (ctx: OnboardingComponentsContext): StepDefin
language: 'bash',
file: 'Expo',
code: dedent`
- npx expo install posthog-react-native expo-file-system expo-application expo-device expo-localization posthog-react-native-session-replay
+ npx expo install posthog-react-native expo-file-system expo-application expo-device expo-localization @posthog/react-native-plugin
`,
},
{
language: 'bash',
file: 'yarn',
code: dedent`
- yarn add posthog-react-native @react-native-async-storage/async-storage react-native-device-info react-native-localize posthog-react-native-session-replay
+ yarn add posthog-react-native @react-native-async-storage/async-storage react-native-device-info react-native-localize @posthog/react-native-plugin
# for iOS
cd ios && pod install
@@ -38,7 +38,7 @@ export const getReactNativeSteps = (ctx: OnboardingComponentsContext): StepDefin
language: 'bash',
file: 'npm',
code: dedent`
- npm i -s posthog-react-native @react-native-async-storage/async-storage react-native-device-info react-native-localize posthog-react-native-session-replay
+ npm i -s posthog-react-native @react-native-async-storage/async-storage react-native-device-info react-native-localize @posthog/react-native-plugin
# for iOS
cd ios && pod install
@@ -46,6 +46,13 @@ export const getReactNativeSteps = (ctx: OnboardingComponentsContext): StepDefin
},
]}
/>
+ <CalloutBox type="fyi" title="Plugin renamed in 4.47.0+">
+ <Markdown>
+ {dedent`
+ \`@posthog/react-native-plugin\` (\`>= 2.0.1\`) is the renamed \`posthog-react-native-session-replay\` plugin — it was renamed in \`posthog-react-native\` 4.47.0+ and now also powers [native error tracking](https://posthog.com/docs/error-tracking/installation/react-native). If you're on a \`posthog-react-native\` version earlier than 4.47.0, install \`posthog-react-native-session-replay\` instead.
+ `}
+ </Markdown>
+ </CalloutBox>
<CalloutBox type="fyi" title="SDK version">
<Markdown>
Session replay requires PostHog React Native SDK version 3.2.0 or higher. We recommend