github getsentry/sentry-react-native 5.26.0

latest releases: 5.33.0, 5.24.2, 6.0.0-beta.1...
2 months ago

Features

  • 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.

Dependencies

Don't miss a new sentry-react-native release

NewReleases is sending notifications on new releases.