Created
August 11, 2023 02:02
-
-
Save techlab23/2fcd45fce2a4ca71ebeb4ebbebf1df02 to your computer and use it in GitHub Desktop.
Sentry Client Plugin For Nuxt 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { defineNuxtPlugin } from '#app' | |
import * as Sentry from '@sentry/vue' | |
export default defineNuxtPlugin((nuxtApp) => { | |
const router = useRouter() | |
const config = useRuntimeConfig() | |
Sentry.init({ | |
app: nuxtApp.vueApp, | |
dsn: config.public.sentryDsn, | |
autoSessionTracking: true, | |
enableTracing: true, | |
integrations: [ | |
new Sentry.BrowserTracing({ | |
routingInstrumentation: Sentry.vueRouterInstrumentation(router), | |
}), | |
], | |
sampleRate: 1, | |
tracesSampleRate: 1, | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment