@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
-
Add the JavaScript library dependency in the
package.jsonfile. -
Install dependencies using the
npm installcommand.
Examples
Initialize Sentry on the top-level of your app, using theSentry.init({...}) method. The only required parameter is dsn, short for Data Source Name. Find the dsn from the Sentry project’s settings page.
Sentry.setContext() or Sentry.setUser(), as shown.
API reference
Additional configuration
Add readable stack traces to Sentry errors
In summary, after the app is built, you should 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, you might have a similar folder structure:-
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 example52). See Sentry official docs for more information. -
Add Sentry Metro Serializer to
metro.config.jsand rebuild the application. -
Install
sentry-cli. See Sentry official docs for more information. -
Create a new Sentry release. Pass the previously defined
$SENTRY_RELEASE_VERSION. See Sentry official docs for more information. -
Upload source maps for JavaScript symbolication. Please note that
sentry-wizardis not yet supported. See Sentry official docs for more information.

