Integrate Sentry in a React Native Expo App

Adil IjazAdil Ijaz
2 min read

Why Sentry?

Whether you're working on a small app or scaling a production-ready product, errors happen. You need visibility into your app’s runtime issues and that’s exactly what Sentry provides.

  • Crash reporting in real time

  • Track unexpected errors in AsyncStorage, network calls, UI rendering

  • Optional performance monitoring and breadcrumbs

  • Works great with React Native and Expo

Step-by-Step Sentry Setup for React Native Expo App

1. Sign up and Create a New Project on Sentry

  • Go to sentry.io and sign up (or log in).

  • From your dashboard, click "Create Project".

2. Select React Native as the Platform

  • Choose React Native from the list of platforms.

  • Enter your project name (e.g. sentry-intgration-app).

  • Click Create Project.

💡 You don’t need to configure anything inside the Sentry dashboard for now. The CLI wizard will take care of that next.

✅ 3. Run the Sentry Wizard CLI

Open your terminal in the Expo app root and run:

npx @sentry/wizard@latest -i reactNative --saas --org organizationName --project projectName

Replace --org and --project with your actual organization.

4. Follow the Terminal-Based Setup

Once you run the wizard, it will guide you through:

  • Installing sentry-expo

  • Creating sentry.config.ts

  • Updating your eas.json

  • Adding post-publish hooks

  • Setting up DSNs and auth tokens

The wizard automatically modifies the required files for sentry. The screenshot is attached which will show the wizard steps after the installation.

5. Test Your Setup

Add a simple error trigger to verify:

<View>
    <Button title="Press me" onPress={() => { throw new Error('Hello, again, Sentry!'); }}/>
</View>

Once the error occurs, head to your Sentry dashboard. You’ll see:

  • A new issue with a full stack trace

  • Device, platform, and app version

  • Breadcrumbs of events before the crash

Bonus Tips

  • Add SENTRY_AUTH_TOKEN and DSNs to your .env file

  • Use Sentry.Native.captureException() inside try/catch blocks

  • Enable performance monitoring with tracesSampleRate

Conclusion

You’ve successfully set up Sentry crash reporting in a React Native Expo app using EAS Build. With minimal code changes and a CLI-based wizard, you can now catch issues proactively and improve your app’s stability.

0
Subscribe to my newsletter

Read articles from Adil Ijaz directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Adil Ijaz
Adil Ijaz

Hi, I’m Adil Ijaz, a full-stack developer with years of experience building scalable web and mobile applications. I currently work at Company, where I focus on developing robust e-commerce solutions using React, NestJS, Node and Shopify including headless and custom app development My journey started in freelance development, delivering high-quality hybrid apps for clients on Fiverr and Upwork. Over time, I’ve expanded into backend architecture, API integrations, and full product development across domains.