---
title: "Migrate from sentry-expo"
description: "Learn about migrating from sentry-expo to @sentry/react-native"
url: https://docs.sentry.io/platforms/react-native/migration/sentry-expo/
---

# Migrate from sentry-expo | Sentry for React Native

This guide scribes how to migrate from `sentry-expo` to `@sentry/react-native` in your Expo application.

## [Remove `sentry-expo`](https://docs.sentry.io/platforms/react-native/migration/sentry-expo.md#remove-sentry-expo)

First, remove `sentry-expo` from your dependencies:

```bash
npm uninstall sentry-expo
```

### [Remove `sentry-expo/upload-sourcemaps` from `postPublish` hooks](https://docs.sentry.io/platforms/react-native/migration/sentry-expo.md#remove-sentry-expoupload-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](https://docs.sentry.io/platforms/react-native/manual-setup/expo.md), as part of the final step of the migration [at the bottom of the page](https://docs.sentry.io/platforms/react-native/migration/sentry-expo.md#set-up-the-sentryreact-native-expo-and-metro-plugins).

## [Install `@sentry/react-native`](https://docs.sentry.io/platforms/react-native/migration/sentry-expo.md#install-sentryreact-native)

Install the `@sentry/react-native` package:

```bash
npx expo install @sentry/react-native
```

### [Fix Imports](https://docs.sentry.io/platforms/react-native/migration/sentry-expo.md#fix-imports)

Replace all imports of `sentry-expo` with `@sentry/react-native`:

```javascript
- import * as Sentry from 'sentry-expo';
+ import * as Sentry from '@sentry/react-native';
```

Replace `sentry-expo` exports `Browser` and `React` with `@sentry/react`:

```javascript
- import { Browser, React } from 'sentry-expo';
+ import * as Browser from '@sentry/react';
+ import * as React from '@sentry/react';
```

Replace `sentry-expo` export `Native` with `@sentry/react-native`:

```javascript
- import { Native } from 'sentry-expo';
+ import * as Sentry from '@sentry/react-native';
```

### [Review `Sentry.init` Options](https://docs.sentry.io/platforms/react-native/migration/sentry-expo.md#review-sentryinit-options)

The `enableInExpoDevelopment` option is no longer supported. If you were using it, remove it and replace it with a `__DEV__` check, or leave the SDK enabled in development.

```javascript
Sentry.init({
-  enableInExpoDevelopment: false,
+  enabled: !__DEV__,
});
```

### [Changes to Default Tags](https://docs.sentry.io/platforms/react-native/migration/sentry-expo.md#changes-to-default-tags)

Expo-specific tags are no longer added by default. If you were using them, you can add them manually:

```javascript
import Constants from "expo-constants";
import * as Application from "expo-application";
import * as Device from "expo-device";
import * as Updates from "expo-updates";

import * as Sentry from "@sentry/react-native";

Sentry.setExtras({
  manifest: Updates.manifest,
  deviceYearClass: Device.deviceYearClass,
  linkingUri: Constants.linkingUri,
});

Sentry.setTag("expoChannel", Updates.channel);
Sentry.setTag("appVersion", Application.nativeApplicationVersion);
Sentry.setTag("deviceId", Constants.sessionId);
Sentry.setTag("executionEnvironment", Constants.executionEnvironment);
Sentry.setTag("expoGoVersion", Constants.expoVersion);
Sentry.setTag("expoRuntimeVersion", Constants.expoRuntimeVersion);
```

## [Review `react-native-web` Compatibility](https://docs.sentry.io/platforms/react-native/migration/sentry-expo.md#review-react-native-web-compatibility)

The `sentry-expo` package automatically switched to `@sentry/react` for `react-native-web` builds. This is no longer the case with `@sentry/react-native` which supports `react-native-web` out of the box.

Note that some features might not be supported or work differently in `@sentry/react-native` on `react-native-web` compared to direct usage of `@sentry/react`. Verify in your application that the features you use work as expected.

To continue using `@sentry/react` for `react-native-web` builds, see [@sentry/react](https://docs.sentry.io/platforms/javascript/guides/react.md) for more details about the web React package.

## [Set Up the `@sentry/react-native` Expo and Metro Plugins](https://docs.sentry.io/platforms/react-native/migration/sentry-expo.md#set-up-the-sentryreact-native-expo-and-metro-plugins)

Next, [set up the Expo and Metro plugins](https://docs.sentry.io/platforms/react-native/manual-setup/expo.md) for `@sentry/react-native`.
