Sentry

  1. 安装 yarn add @sentry/browser @sentry/tracing
  2. Sentry.init({ dsn: “https://examplePublicKey@o0.ingest.sentry.io/0”, })
  3. use: Sentry.captureException(err)

Sentry - integrations

Sentry.init({
  // ...

  integrations: [new MyAwesomeIntegration()],
});

@nuxt/sentry

  1. yarn add @nuxtjs/sentry
  2. nuxt.config.js
    {
      modules: [
     '@nuxtjs/sentry'
      ],
      sentry: {
     dsn: '', // Enter your project's DSN here
     config: {}, // Additional config
      }
    }
    

    3.usage ``` Usage in Vue components: this.$sentry.captureException(error)

Usage in asyncData: async asyncData ({ params, $sentry }) { try { let { data } = await axios.get(https://my-api/posts/${params.id}) return { title: data.title } } catch (error) { $sentry.captureException(error) } }

```