Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/integrations/deployment/expo/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ To see your Sentry Issues and Replays in Expo dashboard, you'll first need to en
npx @sentry/wizard@latest -i reactNative
```

For more details on using Sentry with Expo, refer to the [Sentry documentation](/platforms/react-native/) for React Native applications.
For more details, see the [Expo guide](/platforms/react-native/guides/expo/), which also documents this EAS dashboard integration.
</Alert>
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ npx @sentry/wizard@latest -i reactNative

</Expandable>

If you're using Expo, [read our docs](/platforms/react-native/manual-setup/expo/) to learn how to add Sentry to your Expo project. This SDK will work for both managed and bare projects.
If you're using Expo, [read our Expo guide](/platforms/react-native/guides/expo/) to learn how to add Sentry to your Expo project. This SDK will work for both managed and bare projects.


## Configure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: "Learn how to enable a custom integration."

In addition to the integrations that come with the SDK, you can also write custom integrations.

Custom integration must conform to the [Integration interface](https://github.com/getsentry/sentry-javascript/blob/master/packages/core/src/types-hoist/integration.ts).
Custom integration must conform to the [Integration interface](https://github.com/getsentry/sentry-javascript/blob/master/packages/core/src/types/integration.ts).

A custom integration can be created and added to the SDK as follows:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ React Native [`0.70`](https://github.com/facebook/react-native/blob/e3a5fbe72f96

</Alert>

For more details see [this issue](https://github.com/facebook/react-native/issues/34043) in the React Native repository.
For more details see [this issue](https://github.com/react/react-native/issues/34043) in the React Native repository.

### Don't Combine Hermes and RAM Bundles

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar_order: 40

The [RAM bundle](https://reactnative.dev/docs/optimizing-javascript-loading) format is a new approach to packaging React Native apps that optimizes your app's startup time. With RAM bundles, it is possible to load to memory only those modules that are needed for specific functionality, and only when needed.

All the existing RAM bundle formats are explained in detail in the [Metro Bundler documentation](https://facebook.github.io/metro/docs/bundling).
All the existing RAM bundle formats are explained in detail in the [Metro Bundler documentation](https://metrobundler.dev/docs/bundling).

## Enabling RAM Bundles

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ To get unminified stack traces for JavaScript code, source maps must be generate

Choose one of the following guides depending on your setup, or try the [automatic upload](#set-up-automatic-upload) to get started.

- [Expo](/platforms/react-native/sourcemaps/uploading/expo/)
- [Expo](/platforms/react-native/guides/expo/sourcemaps/uploading/expo/)
- [Hermes](/platforms/react-native/sourcemaps/uploading/hermes/)
- [JavaScript Core (JSC)](/platforms/react-native/sourcemaps/uploading/jsc/)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ When no routing instrumentation is used, a transaction for `App Start` is automa

We currently provide three routing instrumentations out of the box to instrument route changes for:

- [Expo Router](/platforms/react-native/tracing/instrumentation/expo-router/)
- [Expo Router](/platforms/react-native/guides/expo/tracing/instrumentation/expo-router/)
- [React Navigation](/platforms/react-native/tracing/instrumentation/react-navigation/)
- [React Native Navigation](/platforms/react-native/tracing/instrumentation/react-native-navigation/)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Learn how to use Sentry's Generic Navigation instrumentation."
sidebar_order: 70
---

Sentry's React Native SDK package ships with instrumentation for [React Navigation](/platforms/react-native/tracing/instrumentation/react-navigation/), [React Native Navigation](/platforms/react-native/tracing/instrumentation/react-native-navigation/), and [Expo Router](/platforms/react-native/tracing/instrumentation/expo-router/). This allows you to see the performance of your navigation transitions and the errors that may occur.
Sentry's React Native SDK package ships with instrumentation for [React Navigation](/platforms/react-native/tracing/instrumentation/react-navigation/), [React Native Navigation](/platforms/react-native/tracing/instrumentation/react-native-navigation/), and [Expo Router](/platforms/react-native/guides/expo/tracing/instrumentation/expo-router/). This allows you to see the performance of your navigation transitions and the errors that may occur.

If you use a navigation library that we don't yet support, or have a custom routing solution, you can use `startIdleNavigationSpan` function to implement your own navigation integration. This page will guide you through setting it up and configuring it to your needs.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ If you're using `React Navigation 5` and you're not receiving transactions anymo

## RAM Bundles Mismatched Line Numbers

If you experience mismatched line numbers on [sentry.io](https://sentry.io) when using RAM Bundles, this is due to a [bug](https://github.com/facebook/metro/issues/399) on the Metro tooling.
If you experience mismatched line numbers on [sentry.io](https://sentry.io) when using RAM Bundles, this is due to a [bug](https://github.com/react/metro/issues/399) on the Metro tooling.

## Uploading source maps from Xcode Cloud

Expand Down Expand Up @@ -313,7 +313,7 @@ $SENTRY_CLI debug-files upload "$INCLUDE_SOURCES_FLAG" "$DWARF_DSYM_FOLDER_PATH"

## Missing Java stack trace on the New Architecture

If you're using the new architecture on React Native, you might be missing the Java stack trace. Follow the [issue](https://github.com/facebook/react-native/issues/34923) for more information.
If you're using the new architecture on React Native, you might be missing the Java stack trace. Follow the [issue](https://github.com/react/react-native/issues/34923) for more information.

## Failing Build Due to `sentry-cli`

Expand Down Expand Up @@ -345,7 +345,7 @@ To resolve the conflict, use one of the following approaches:

- **Use only one tool to wrap the build phase.** If only one of the SDKs captures errors, only that SDK needs to wrap the build phase. The other SDK, if it's not used for error reporting, doesn't need automatic debug-file upload.

- **Upload debug files manually.** Disable both tools' automatic upload and upload source maps yourself. See [Manual Upload for Hermes Release](/platforms/react-native/sourcemaps/uploading/expo-advanced/).
- **Upload debug files manually.** Disable both tools' automatic upload and upload source maps yourself. See [Manual Upload for Hermes Release](/platforms/react-native/guides/expo/sourcemaps/uploading/expo-advanced/).

### Expo

Expand Down
16 changes: 16 additions & 0 deletions docs/platforms/react-native/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
title: React Native
# platformTitle is the dropdown/group label on the home page and platform
# selector. Setting it injects the platform itself as a default guide, so the
# "React Native" group lists both "React Native" (bare/CLI) and "Expo" as
# siblings (mirrors how "JavaScript" groups "Browser JavaScript" + frameworks).
platformTitle: React Native
sidebar_title: React Native
caseStyle: camelCase
supportLevel: production
sdk: sentry.javascript.react-native
fallbackPlatform: javascript
categories:
- mobile
keywords:
- react-native
- expo
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
---
title: Expo
description: "Learn how to set up an Expo-managed project with the Sentry React Native SDK."
description: "Learn how to set up an Expo project with Sentry's React Native SDK, including the Sentry Expo config plugin, Expo Router tracing, Expo Updates context, and the EAS dashboard integration."
caseStyle: camelCase
supportLevel: production
sdk: sentry.javascript.react-native
fallbackPlatform: react-native
categories:
- mobile
---

To set up the Sentry React Native SDK in your Expo project, follow the steps on this page.
<AgentSkillsCallout skill="sentry-react-native-sdk" platformName="Expo" />

Use this guide to get fully set up with Sentry's React Native SDK in an [Expo](https://expo.dev/) project. The same `@sentry/react-native` SDK powers both bare React Native and Expo apps. This guide covers the Expo-specific setup (config plugin, Metro, EAS) and integrations.

<Alert>

If you don't already have an account and Sentry project established, head over to [sentry.io](https://sentry.io/signup/), then return to this page.

</Alert>

## Prerequisites

- [Expo SDK 50](https://docs.expo.dev/workflow/upgrading-expo-sdk-walkthrough/) or newer.
- [Expo SDK 49](https://docs.expo.dev/guides/using-sentry/) and older are supported by the `sentry-expo` package.
- [Migrate from `sentry-expo` to `@sentry/react-native`](/platforms/react-native/migration/sentry-expo/).
- [Expo SDK 50](https://docs.expo.dev/workflow/upgrading-expo-sdk-walkthrough/) or newer. The `@sentry/react-native` SDK requires Expo SDK 50+.
- On [Expo SDK 49](https://docs.expo.dev/guides/using-sentry/) or older, the legacy `sentry-expo` package was used. It's now deprecated — [migrate to `@sentry/react-native`](/platforms/react-native/guides/expo/migration/sentry-expo/) to keep receiving updates.
- [Sign up for an account](https://sentry.io/signup/).

## Automatic Install

Use the [Sentry Wizard](https://github.com/getsentry/sentry-wizard) to patch your project automatically, as shown below. Alternatively, you can follow the [Manual Install](./#manual-install) if you prefer. You only need to patch the project once. Then, you can add the patched files to your version control system.
Use the Sentry Wizard to patch your project automatically, as shown below. Alternatively, you can follow the [Manual Install](#manual-install) if you prefer. You only need to patch the project once. Then, you can add the patched files to your version control system.

```bash {tabTitle:npm}
npx @sentry/wizard@latest -i reactNative
Expand Down Expand Up @@ -58,10 +71,10 @@ pnpm add @sentry/react-native

<OnboardingOptionButtons
options={[
'error-monitoring',
'performance',
'profiling',
'session-replay',
"error-monitoring",
"performance",
"profiling",
"session-replay",
"logs",
]}
/>
Expand Down Expand Up @@ -98,7 +111,7 @@ Sentry.init({
// Record session replays for 100% of errors and 10% of sessions
replaysOnErrorSampleRate: 1.0,
replaysSessionSampleRate: 0.1,
integrations: [Sentry.mobileReplayIntegration()],
integrations: [Sentry.mobileReplayIntegration()],
// ___PRODUCT_OPTION_END___ session-replay
});

Expand All @@ -119,7 +132,7 @@ export default Sentry.wrap(RootLayout);

### Add the Sentry Expo Plugin

To ensure bundles and source maps are automatically uploaded during the native applications builds, add `withSentry` to the Expo application configuration:
To ensure bundles and source maps are automatically uploaded during the native application builds, add the Sentry plugin to your Expo app configuration. Add it to the `plugins` array in `app.json`, or wrap your config with `withSentry` in `app.config.js`/`app.config.ts`:

<Include name="react-native-expo-plugin-code-snippet.mdx" />

Expand All @@ -131,7 +144,7 @@ To ensure unique Debug IDs get assigned to the generated bundles and source maps

### Add Privacy Manifest

The SDK needs access to certain information about the device and the application for its essential functionality. Some of the APIs required for this are considered privacy-relevant. Add the privacy manifest to your Xcode project to ensure your app is compliant with Apple's guidelines. Read the [Apple Privacy Manifest](/platforms/react-native/data-management/apple-privacy-manifest/) guide for more info on how to add records required for the Sentry SDKs.
The SDK needs access to certain information about the device and the application for its essential functionality. Some of the APIs required for this are considered privacy-relevant. Add the privacy manifest to your Xcode project to ensure your app is compliant with Apple's guidelines. Read the [Apple Privacy Manifest](/platforms/react-native/guides/expo/data-management/apple-privacy-manifest/) guide for more info on how to add records required for the Sentry SDKs.

## Verify Setup

Expand All @@ -146,25 +159,52 @@ To verify that everything is working as expected, build the `Release` version of
/>
```

## Next Steps
## Expo-Specific Features

### Expo-Specific Features
- [Expo Updates](/platforms/react-native/guides/expo/manual-setup/expo/expo-updates/) — Automatic OTA update context, searchable tags, and emergency launch alerts
- [EAS Build Hooks](/platforms/react-native/guides/expo/manual-setup/expo/eas-build-hooks/) — Capture build failures and lifecycle events from EAS Build
- [Sentry Android Gradle Plugin](/platforms/react-native/guides/expo/manual-setup/expo/gradle/) — Advanced Android build configuration
- [Expo Router tracing](/platforms/react-native/guides/expo/tracing/instrumentation/expo-router/) — Navigation transitions, performance spans, and prefetch instrumentation
- [Expo Image and Asset tracing](/platforms/react-native/guides/expo/tracing/instrumentation/expo-resources/) — Automatic spans for `expo-image` and `expo-asset`
- [Upload source maps for native builds and Expo Updates](/platforms/react-native/guides/expo/sourcemaps/uploading/expo/)

- [Expo Updates](/platforms/react-native/manual-setup/expo/expo-updates/) — Automatic OTA update context, searchable tags, and emergency launch alerts
- [EAS Build Hooks](/platforms/react-native/manual-setup/expo/eas-build-hooks/) — Capture build failures and lifecycle events from EAS Build
- [Sentry Android Gradle Plugin](/platforms/react-native/manual-setup/expo/gradle/) — Advanced Android build configuration
## Notes

### Source Maps and Releases
- Don't commit your auth token. Store it in `.env.local` as `SENTRY_AUTH_TOKEN` for local builds, and as an [EAS secret](https://docs.expo.dev/eas/environment-variables/) for EAS builds.
- Source maps for the `Release` version of your application are uploaded automatically during the native application build.
- During development, the source code is resolved using the Metro Server and source maps aren't used. This currently doesn't work on web.

- [Upload source maps for native builds and Expo Updates](/platforms/react-native/sourcemaps/uploading/expo/)
## Integrate Sentry with your EAS dashboard

### Performance
Once the SDK is set up, you can also connect Sentry to [Expo Application Services (EAS)](https://expo.dev/eas) so crash reports and [Session Replays](/platforms/react-native/guides/expo/session-replay/) for your deployments show up directly in your EAS dashboard, with direct links to Sentry stack traces and full debugging context.

- [Expo Router tracing](/platforms/react-native/tracing/instrumentation/expo-router/) — Navigation transitions, performance spans, and prefetch instrumentation
- [Expo Image and Asset tracing](/platforms/react-native/tracing/instrumentation/expo-resources/) — Automatic spans for `expo-image` and `expo-asset`
<Alert level="warning">

## Notes
If you change your organization slug, you'll need to update your configuration for this integration. Learn more in our [troubleshooting guide](/integrations/troubleshooting).

- Don't commit your auth token. Store it in `.env.local` as `SENTRY_AUTH_TOKEN` for local builds, and as an [EAS secret](https://docs.expo.dev/eas/environment-variables/) for EAS builds.
- Source maps for the `Release` version of your application are uploaded automatically during the native application build.
- During development, the source code is resolved using the Metro Server and source maps aren't used. This currently doesn't work on web.
</Alert>

### Install the integration

<Alert>

Sentry owner, manager, or admin permissions are required to install this integration.

</Alert>

1. Log in to your Expo dashboard and open **Account Settings > Overview** (`https://expo.dev/accounts/[your-account]/settings`).
2. Locate the **Connections** section and click **Connect** next to Sentry.
3. Log in to Sentry and accept the integration into your organization. You'll be redirected back to Account Settings > Overview.

### Link your projects

After connecting your accounts, link your Expo project to your Sentry project:

1. Open **Projects > [Your Project] > Configuration > Project settings** in the Expo dashboard.
2. Click **Link** and select your Sentry project from the dropdown.

### View Sentry data in EAS

To see your Sentry issues and replays in the Expo dashboard, first make sure you've created an [EAS Update channel](https://docs.expo.dev/eas-update/how-it-works/) and assigned builds to it to create an [EAS deployment](https://docs.expo.dev/eas-update/deployment/). Then:

1. Open **Projects > [Your Project] > Updates > Deployments > [Deployment]** to view Sentry data from a release.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pnpm remove sentry-expo

### Remove `sentry-expo/upload-sourcemaps` from `postPublish` hooks

Remove the Sentry Source Maps Upload hook from your Expo Application configuration, `expo.hooks.postPublish`. The new methods of uploading source maps are described in the [new Expo guide](/platforms/react-native/manual-setup/expo/), as part of the final step of the migration [at the bottom of the page](/platforms/react-native/migration/sentry-expo/#set-up-the-sentryreact-native-expo-and-metro-plugins).
Remove the Sentry Source Maps Upload hook from your Expo Application configuration, `expo.hooks.postPublish`. The new methods of uploading source maps are described in the [new Expo guide](/platforms/react-native/guides/expo/), as part of the final step of the migration [at the bottom of the page](/platforms/react-native/guides/expo/migration/sentry-expo/#set-up-the-sentryreact-native-expo-and-metro-plugins).

## Install `@sentry/react-native`

Expand Down Expand Up @@ -124,4 +124,4 @@ To continue using `@sentry/react` for `react-native-web` builds, see [@sentry/re

## Set Up the `@sentry/react-native` Expo and Metro Plugins

Next, [set up the Expo and Metro plugins](/platforms/react-native/manual-setup/expo/) for `@sentry/react-native`.
Next, [set up the Expo and Metro plugins](/platforms/react-native/guides/expo/) for `@sentry/react-native`.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ description: "Manually upload source maps for native Expo releases."

Sentry's React Native SDK works out of the box with Expo applications. To see readable stack traces in the product, you must upload source maps to Sentry. This guide explains how to manually upload source maps for Expo application releases.

For a guide on how to automatically upload source maps for Expo application releases or updates, see the [Expo](/platforms/react-native/sourcemaps/uploading/expo/) source maps docs.
For a guide on how to automatically upload source maps for Expo application releases or updates, see the [Expo](/platforms/react-native/guides/expo/sourcemaps/uploading/expo/) source maps docs.

## Prerequisites

- [Sign up for an account](https://sentry.io/signup/)
- [Migrate from `sentry-expo` to `@sentry/react-native`](/platforms/react-native/migration/sentry-expo/)
- [Set up Sentry React Native SDK](/platforms/react-native/manual-setup/expo/) version 5.16.0-alpha.4 or newer
- [Migrate from `sentry-expo` to `@sentry/react-native`](/platforms/react-native/guides/expo/migration/sentry-expo/)
- [Set up Sentry React Native SDK](/platforms/react-native/guides/expo/) version 5.16.0-alpha.4 or newer

<OrgAuthTokenNote />

Expand Down
Loading
Loading