@sentry/react-native
Advanced tools
Changelog
6.0.0-alpha.2
Changelog
6.0.0-alpha.0
This is an alpha version of the next major version of the Sentry React Native SDK 6.0.0. Please read the changes listed below as well as the changes made in the underlying Sentry Javascript SDK 8.0.0 (JS Docs).
Removed deprecated ReactNativeTracing option idleTimeout
use idleTimeoutMs
instead (#3998)
Removed deprecated ReactNativeTracing option maxTransactionDuration
use finalTimeoutMs
instead (#3998)
Removed beforeNavigate
use beforeStartSpan
instead (#3998)
beforeStartSpan
is executed before the span start, compared to beforeNavigate
which was executed before the navigation ended (after the span was created)New Native Frames Integration (#3996)
New Stall Tracking Integration (#3997)
New User Interaction Tracing Integration (#3999)
New App Start Integration (#3852)
By default app start spans are attached to the first created transaction. Standalone mode creates single root span (transaction) including only app start data.
import * as Sentry from '@sentry/react-native';
Sentry.init({
tracesSampleRate: 1.0,
enableAppStartTracking: true, // default true
enableNativeFramesTracking: true, // default true
enableStallTracking: true, // default true
enableUserInteractionTracing: true, // default false
integrations: [
Sentry.reactNativeTracingIntegration({
beforeStartSpan: (startSpanOptions) => {
startSpanOptions.name = 'New Name';
return startSpanOptions;
},
}),
Sentry.appStartIntegration({
standalone: false, // default false
}),
],
});
New React Navigation Integration interface (#4003)
import * as Sentry from '@sentry/react-native';
import { NavigationContainer } from '@react-navigation/native';
const reactNavigationIntegration = Sentry.reactNavigationIntegration();
Sentry.init({
tracesSampleRate: 1.0,
integrations: [reactNavigationIntegration],
});
function RootComponent() {
const navigation = React.useRef(null);
return <NavigationContainer ref={navigation}
onReady={() => {
reactNavigationIntegration.registerNavigationContainer(navigation);
}}>
</NavigationContainer>;
}
New React Native Navigation Integration interface (#4003)
import * as Sentry from '@sentry/react-native';
import { Navigation } from 'react-native-navigation';
Sentry.init({
tracesSampleRate: 1.0,
integrations: [
Sentry.reactNativeNavigationIntegration({ navigation: Navigation })
],
});
Add spotlight
option (#4023)
enableSpotlight
and spotlightSidecarUrl
Changelog
5.29.0
TimeToInitialDisplay
and TimeToFullDisplay
start the time to display spans on mount (#4020)Sentry.addBreadcrumb({ data: [] })
(#4021)
data
type is plain JS object, otherwise the data might be lost.requireNativeComponent
missing in react-native-web
(#3958)Changelog
Changelog
5.26.0
Session Replay Public Beta (#3830)
To enable Replay use the replaysSessionSampleRate
or replaysOnErrorSampleRate
options.
import * as Sentry from '@sentry/react-native';
Sentry.init({
_experiments: {
replaysSessionSampleRate: 1.0,
replaysOnErrorSampleRate: 1.0,
},
});
To add React Component Names use annotateReactComponents
in metro.config.js
.
// For Expo
const { getSentryExpoConfig } = require("@sentry/react-native/metro");
const config = getSentryExpoConfig(__dirname, { annotateReactComponents: true });
// For RN
const { getDefaultConfig } = require('@react-native/metro-config');
const { withSentryConfig } = require('@sentry/react-native/metro');
module.exports = withSentryConfig(getDefaultConfig(__dirname), { annotateReactComponents: true });
To change default redaction behavior add the mobileReplayIntegration
.
import * as Sentry from '@sentry/react-native';
Sentry.init({
_experiments: {
replaysSessionSampleRate: 1.0,
replaysOnErrorSampleRate: 1.0,
},
integrations: [
Sentry.mobileReplayIntegration({
maskAllImages: true,
maskAllVectors: true,
maskAllText: true,
}),
],
});
To learn more visit Sentry's Mobile Session Replay documentation page.