> For the complete documentation index, see [llms.txt](https://mercure-technologies.gitbook.io/xprem/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mercure-technologies.gitbook.io/xprem/integrations/sentry.md).

# Sentry

#### 1. Set up Sentry in your app

Follow [Sentry's Expo guide](https://docs.sentry.io/platforms/react-native/manual-setup/expo/). It adds the `@sentry/react-native/expo` plugin and the Metro config Sentry needs to match a crash to its source map.

#### 2. Set the environment variables

| Variable                          | When                                               |
| --------------------------------- | -------------------------------------------------- |
| `SENTRY_AUTH_TOKEN`               | Always                                             |
| `SENTRY_ORG` and `SENTRY_PROJECT` | If the Sentry plugin in your app config lacks them |
| `SENTRY_URL`                      | Self-hosted Sentry only                            |

#### 3. Upload the source maps after each publish

`eoas publish` writes the source maps to `dist/`. Do not pass `--no-dumpSourcemap`, which turns them off.

```bash
example: npx eoas publish --branch production --nonInteractive
npx sentry-expo-upload-sourcemaps dist
```

If you publish with `--outputDir`, pass that directory instead of `dist`.
