Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sentry/react-native

Package Overview
Dependencies
Maintainers
10
Versions
247
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sentry/react-native

Official Sentry SDK for react-native

  • 1.0.0-beta.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
361K
decreased by-10.04%
Maintainers
10
Weekly downloads
 
Created

What is @sentry/react-native?

@sentry/react-native is a comprehensive error tracking and performance monitoring tool for React Native applications. It helps developers capture and report errors, monitor application performance, and gain insights into issues affecting their apps.

What are @sentry/react-native's main functionalities?

Error Tracking

This feature allows you to capture and report errors in your React Native application. The code sample initializes Sentry with a DSN and captures an exception.

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

Sentry.init({
  dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0',
});

try {
  throw new Error('Test error');
} catch (error) {
  Sentry.captureException(error);
}

Performance Monitoring

This feature allows you to monitor the performance of your application. The code sample initializes Sentry with a DSN and a traces sample rate, then starts and finishes a transaction.

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

Sentry.init({
  dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0',
  tracesSampleRate: 1.0,
});

const transaction = Sentry.startTransaction({
  name: 'test-transaction',
});

setTimeout(() => {
  transaction.finish();
}, 2000);

Breadcrumbs

Breadcrumbs are used to record events that lead up to an error. The code sample initializes Sentry and adds a breadcrumb for a user login event.

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

Sentry.init({
  dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0',
});

Sentry.addBreadcrumb({
  category: 'auth',
  message: 'User logged in',
  level: Sentry.Severity.Info,
});

User Feedback

This feature allows users to provide feedback when an error occurs. The code sample initializes Sentry and shows a report dialog for user feedback.

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

Sentry.init({
  dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0',
});

Sentry.showReportDialog({
  title: 'Feedback',
  subtitle: 'Please describe what you were doing when the error occurred.',
  labelName: 'Name',
  labelEmail: 'Email',
  labelComments: 'Comments',
  labelSubmit: 'Submit',
  successMessage: 'Thank you for your feedback!',
});

Other packages similar to @sentry/react-native

Keywords

FAQs

Package last updated on 25 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc