This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
mobile-app/src/libs/sentry/initSentry.ts

28 lines
667 B
TypeScript

import * as Sentry from '@sentry/react-native';
import Config from 'react-native-config';
export const routingInstrumentation = new Sentry.ReactNavigationInstrumentation();
const initSentry = () => {
if (!Config.SENTRY_DSN) {
return;
}
Sentry.init({
dsn: Config.SENTRY_DSN,
environment: __DEV__ ? 'development' : 'production',
integrations: [
new Sentry.ReactNativeTracing({
tracingOrigins: [Config.RAW_API_URL],
routingInstrumentation,
}),
],
tracesSampleRate: 0.3,
release: __DEV__
? 'com.dawidwysokinski.zdamegzaminzawodowy@development'
: undefined,
});
};
export default initSentry;