Upgrading from 6.x to 7.0
Version 7 of the Sentry React Native SDK primarily introduces API cleanup and version support changes based on the Sentry Javascript SDK versions 9 and 10. This update contains 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.
Version 7 of the SDK is compatible with Sentry self-hosted versions 25.2.0 or higher (up from 24.4.2 for v6). Lower versions may continue to work, but may not support all features.
See our migration docs for more information.
Major Changes
-
Ensure IP address is only inferred by Relay if
sendDefaultPii
istrue
(#5111) -
Set
{{auto}}
ifuser.ip_address
isundefined
andsendDefaultPii: true
(#4466) -
Sentry.captureUserFeedback
removed, useSentry.captureFeedback
instead (#4855) -
Exceptions from
captureConsoleIntegration
are now marked as handled: true by default -
shutdownTimeout
moved fromcore
to@sentry/react-native
-
hasTracingEnabled
was renamed tohasSpansEnabled
-
You can no longer drop spans or return null on
beforeSendSpan
hook -
Tags formatting logic updated (#4965)
Here are the altered/unaltered types, make sure to update your UI filters and alerts.Unaltered: string, null, number, and undefined values remain unchanged.
Altered: Boolean values are now capitalized: true -> True, false -> False.
Removed types
- TransactionNamingScheme
- Request
- Scope (prefer using the Scope class)
Other removed items.
autoSessionTracking
from options.
To enable session tracking, ensure thatenableAutoSessionTracking
is enabled.enableTracing
. Instead, settracesSampleRate
to a value greater thanzero
toenable tracing
,0
to keep tracing integrations active without sampling, orundefined
to disable the performance integration.getCurrentHub()
,Hub
, andgetCurrentHubShim()
spanId
from propagationcontext
- metrics API
transactionContext
fromsamplingContext
@sentry/utils
package, the exports were moved to@sentry/core
- Standalone
Client
interface & deprecateBaseClient
Changes
- Expose
featureFlagsIntegration
(#4984) - Expose
logger
andconsoleLoggingIntegration
(#4930) - Remove deprecated
appOwnership
constant use in Expo Go detection (#4893) - Disable AppStart and NativeFrames in unsupported environments (web, Expo Go) (#4897)
- Use
Replay
interface forbrowserReplayIntegration
return type (#4858) - Allow using
browserReplayIntegration
withoutisWeb
guard (#4858)- The integration returns noop in non-browser environments
- Use single
encodeUTF8
implementation through the SDK (#4885) - Use global
TextEncoder
(available with Hermes in React Native 0.74 or higher) to improve envelope encoding performance. (#4874) breadcrumbsIntegration
disables React Native incompatible options automatically (#4886)- Fork
scope
if custom scope is passed tostartSpanManual
orstartSpan
- On React Native Web,
browserSessionIntegration
is added whenenableAutoSessionTracking
is set toTrue
(#4732) - Change
Cold/Warm App Start
span description toCold/Warm Start
(#4636)
Features
To enable it add the following code to your Sentry Options:
Sentry.init({
enableLogs: true,
});
You can also filter the logs being collected by adding beforeSendLogs
Sentry.init({
enableLogs: true,
beforeSendLog: log => {
return log;
},
});
- Automatically detect Release name and version for Expo Web (#4967)
Fixes
- Align span description with other platforms (#4636) by @krystofwoldrich
- Tags with symbol are now logged (#4965)
- IgnoreError now filters Native errors (#4948)
You can use strings to filter errors or RegEx for filtering with a pattern.
example:
ignoreErrors: [
'1234', // Will filter any error message that contains 1234.
'.*1234', // Will not filter as regex, instead will filter messages that contains '.*1234"
/.*1234/, // Regex will filter any error message that ends with 1234
/.*1234.*/ // Regex will filter any error message that contains 1234.
]
- Expo Updates Context is passed to native after native init to be available for crashes (#4808)
- Expo Updates Context values should all be lowercase (#4809)
- Avoid duplicate network requests (fetch, xhr) by default (#4816)
traceFetch
is disabled by default on mobile as RN uses a polyfill which will be traced bytraceXHR