setup.ts 550 B

123456789101112131415161718
  1. import * as Sentry from "@sentry/react";
  2. import { Integrations } from "@sentry/tracing";
  3. const SENTRY_DSN = process.env.SENTRY_DSN;
  4. const SENTRY_ENV = process.env.SENTRY_ENV || "development";
  5. export const SetupSentry = () => {
  6. if (!SENTRY_DSN) {
  7. return;
  8. }
  9. Sentry.init({
  10. dsn: SENTRY_DSN,
  11. integrations: [new Integrations.BrowserTracing()],
  12. environment: SENTRY_ENV,
  13. // Check out https://docs.sentry.io/platforms/javascript/guides/react/configuration/sampling/ for a more refined sample rate
  14. tracesSampleRate: 1,
  15. });
  16. };