sentry.client.ts 466 B

12345678910111213141516171819202122
  1. import * as Sentry from '@sentry/nuxt'
  2. export default defineNuxtPlugin(() => {
  3. const { public: { SENTRY_DSN } } = useRuntimeConfig()
  4. const sentry = Sentry.init({
  5. dsn: import.meta.dev ? '' : SENTRY_DSN,
  6. integrations: [Sentry.replayIntegration()],
  7. tracesSampleRate: 1.0,
  8. tracePropagationTargets: ['localhost'],
  9. replaysSessionSampleRate: 0.1,
  10. replaysOnErrorSampleRate: 1.0,
  11. })
  12. return {
  13. provide: {
  14. sentry,
  15. }
  16. }
  17. })