Skip to content

Instantly share code, notes, and snippets.

@techlab23
Created August 11, 2023 02:02
Show Gist options
  • Save techlab23/2fcd45fce2a4ca71ebeb4ebbebf1df02 to your computer and use it in GitHub Desktop.
Save techlab23/2fcd45fce2a4ca71ebeb4ebbebf1df02 to your computer and use it in GitHub Desktop.
Sentry Client Plugin For Nuxt 3
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