Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Skip to main content
Sentry is an error tracking and performance monitoring platform that helps you solve problems and continuously learn about your apps. The @amazon-devices/sentry__react-native library implements the React Native SDK for Sentry on the Vega platform. During this phase, some of the Sentry features are not setup for Vega. You can post questions or report issues on the Vega Developer Forums.

Installation

  1. Add the JavaScript library dependency in the package.json file. Select the tab for your React Native version.
  1. Install dependencies using npm install command.

Examples

Initialize Sentry on the top-level of you app. To initialize Sentry use the Sentry.init({...}) method. The only required parameter is the dsn, short for Data Source Name. Find the dsn from the Sentry project’s settings page.
After initializing Sentry all uncaught exceptions are found automatically and reported by Sentry. You don’t need to send events manually. You can also add extra information to the Sentry events using Sentry.setContext() or Sentry.setUser(), shown below.

API reference

  • Sentry.init(options: ReactNativeOptions) - initializes Sentry. After calling it all errors will be reported by Sentry. If you application crashes or throws uncaught exception before the call to Sentry.init() it won’t be caught by Sentry.
  • Sentry.nativeCrash() - this method triggers native crash, tested and verified to work on Vega devices and simulator.
  • Sentry.setUser(user: User) - sets user data (e.g., username, email) that will be included in Sentry events.
  • Sentry.setContext(contextKey: string, contextData: Object) - sets custom data to be add under the passed contextKey that will be included in Sentry events.
  • Sentry.flush() - Wait for all Sentry events to be sent.
  • Sentry.captureMessage(message: string) - Captures a message event and sends it to Sentry.
  • Sentry.captureException(exception: Error) - Captures an exception event and sends it to Sentry.

Additional configuration

Add readable stack traces to Sentry errors

After the app is built, you need to notify Sentry about the app release name, version, and dist number and send sourcemaps of the JavaScript bundle and debug files. This ensures that Sentry catches events and correctly maps the information with readable stack traces. After building the app, the folder structure might look like this:
  1. Define Sentry release metadata In the Sentry initialization create a release version and a dist version. You need to define $SENTRY_RELEASE_VERSION (for example, my-vega-project@2.3.12) and $SENTRY_DIST_NUMBER (for example 52). See Sentry official docs for more information.
  2. Add Sentry Metro Serializer to metro.config.js and rebuild the application
  3. Install sentry-cli. See Sentry official docs for more information.
  4. Create the Sentry release Create a new Sentry release. You need to pass the previously defined $SENTRY_RELEASE_VERSION. See Sentry official docs for more information.
  5. Upload JavaScript source maps Upload source maps for JavaScript symbolication. Please note that sentry-wizard is not yet supported. See Sentry official docs for more information.
After sending the information to Sentry, you will receive precise information regarding where errors occur in your app.

Implementation details

Known issues

  • Runtime error capturing is not working on Vega.

Known limitations

Sentry.init() missing options

Supported versions

Additional resources

For information on additonal libraries, see Supported Third-Party Libraries and Services.
Last modified on July 10, 2026