|
| 1 | +--- |
| 2 | +title: Migrate from 6.x to 7.x |
| 3 | +sidebar_order: 99 |
| 4 | +description: "Learn how to migrate from version 6 to version 7 of the Sentry React Native SDK" |
| 5 | +--- |
| 6 | + |
| 7 | +<Alert level="warning" title="Important"> |
| 8 | +Version 7 is still under development, this documentation may change before the final release. |
| 9 | +</Alert> |
| 10 | + |
| 11 | +The main goal of version 7 of the Sentry React Native SDK is to provide compatibility with Sentry JavaScript version 9. This update includes breaking changes due to the upgrade to JavaScript SDK v9, the removal of deprecated APIs, and a reorganization of the npm package structure. |
| 12 | + |
| 13 | +## Important Changes in Dependencies |
| 14 | + |
| 15 | +The Sentry React Native SDK ships with the Sentry JavaScript SDK Version 9 as a dependency. This version includes a number of behavioral changes that will not be caught by type checkers, linters, or tests, so we recommend carefully reading through the entire migration guide instead of relying on automatic tooling. Please follow [the JavaScript migration guides](/platforms/javascript/guides/react/migration/v8-to-v9/) to complete the upgrade. |
| 16 | + |
| 17 | +The initial `@sentry/[email protected]` ships with `@sentry/[email protected]`. Always use the exact JavaScript SDK version if adding it manually to your project. Any other version might not be compatible with the React Native SDK. |
| 18 | + |
| 19 | +Version 7 also includes a major upgrade to the Android SDK dependency, introducing behavioral changes, breaking changes, and deprecations. If you are using the Android SDK directly, please follow the [Android SDK version 8 migration guide](/platforms/android/migration/#migrating-from-iosentrysentry-7x-to-iosentrysentry-800). |
| 20 | + |
| 21 | +### Major Changes in Sentry JS SDK v9 |
| 22 | + |
| 23 | +Other general JavaScript SDK version 9 changes are described in the [JavaScript SDK 8.x to 9.x migration guide](/platforms/javascript/guides/react/migration/v8-to-v9/). |
| 24 | + |
| 25 | +### Self-Hosted Sentry Compatibility |
| 26 | + |
| 27 | +Beginning with version 7.0.0, the Sentry Capacitor SDK will only support self-hosted Sentry instances version 25.2.0 and above. This change does not affect users of `sentry.io`. |
| 28 | + |
| 29 | +## Important React Native SDK `7.x` Changes |
| 30 | + |
| 31 | +This section describes API changes in the Sentry React Native SDK, version 7. |
| 32 | + |
| 33 | +### `captureUserFeedback` is now removed |
| 34 | + |
| 35 | +You can use the updated snippet in order to capture user Feedback: |
| 36 | + |
| 37 | +```javascript diff |
| 38 | ++ import { captureFeedback } from '@sentry/react-native'; |
| 39 | +- import { captureUserFeedback } from '@sentry/react-native'; |
| 40 | + |
| 41 | ++ captureUserFeedback({ |
| 42 | +- captureFeedback({ |
| 43 | + name: 'my name', |
| 44 | + |
| 45 | + message: 'it broke', |
| 46 | + associatedEventId: 'eventID', |
| 47 | + }); |
| 48 | +``` |
| 49 | +
|
| 50 | +Additionally you can also see our new Feedback integration by checking the [User Feedback Configuration guide](../../user-feedback/configuration/) |
| 51 | +
|
| 52 | +### `autoSessionTracking` united with `enableAutoSessionTracking` |
| 53 | +
|
| 54 | +Option key `autoSessionTracking` was removed. Use `enableAutoSessionTracking` instead, enabled by default. |
| 55 | +
|
| 56 | +```javascript diff |
| 57 | +Sentry.init({ |
| 58 | ++ enableAutoSessionTracking: true, |
| 59 | +- autoSessionTracking: true, |
| 60 | +}); |
| 61 | +``` |
| 62 | +
|
| 63 | +### `browserReplayIntegration` can be used directly without the `isWeb` check |
| 64 | +
|
| 65 | +The check is now done inside of the integration, simplifying workflows. |
| 66 | +
|
| 67 | +```javascript diff |
| 68 | +Sentry.init({ |
| 69 | ++ integrations: [ Sentry.browserReplayIntegration() ], |
| 70 | +- integrations: (defaultIntegrations) => { |
| 71 | +- if (Platform.OS === 'web') { |
| 72 | +- defaultIntegrations.push(Sentry.browserReplayIntegration()); |
| 73 | +- } |
| 74 | +- return defaultIntegrations; |
| 75 | +- }, |
| 76 | +}); |
| 77 | +``` |
| 78 | +
|
| 79 | +### `Cold/Warm App Start` spans were renamed to `Cold/Warm Start` |
| 80 | +
|
| 81 | +The `App` word was removed from the span description. If you have any logic in your application or in Sentry based on this span description, please, make sure to update. |
| 82 | +
|
| 83 | +### Detection of Expo Go uses `ExpoGo` module |
| 84 | +
|
| 85 | +Starting with version 7.0.0, the Sentry React Native SDK will use the `ExpoGo` module to detect if the application is running on Expo Go. This differs from the previous behavior, where the SDK would check for the deprecated `appOwnership` property. This new approach doesn't work for Expo SDK 49 and older. |
| 86 | +The minimum supported Expo SDK version is 50, same as in Sentry React Native SDK v6. |
0 commit comments