Integrating Sentry with Expo
April 4, 2019
Sentry + Expo (Managed)
code
npx expo install sentry-expo
In App.tsx:
code
import * as Sentry from "sentry-expo";
Sentry.init({
dsn: "https://<public_dsn>@sentry.io/<project_id>",
enableInExpoDevelopment: true,
debug: false,
});
Source Maps Upload
Bei EAS Build kannst du Source Maps automatisch hochladen, wenn du SENTRY_AUTH_TOKEN setzt.
app.config.js (optional, legacy hook):
code
export default {
hooks: {
postPublish: [
{
file: "sentry-expo/upload-sourcemaps",
config: {
organization: "org",
project: "project",
authToken: process.env.SENTRY_AUTH_TOKEN,
},
},
],
},
};
Tipps
SENTRY_AUTH_TOKENnie ins Repo- Release/Dist konsequent setzen, falls du mehrere Environments hast