0.1.1 • Published 3 years ago

@tanakaworld/nuxt-sentry v0.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

nuxt-sentry

CircleCI npm

A sentry module for Nuxt with nuxt-env

Features

The module enables error logging through Sentry.

nuxt-env is supported, so you can set DSN via runtime environment.

Dependencies

Get Started

$ npm i -S @tanakaworld/nuxt-sentry
# or
$ yarn add @tanakaworld/nuxt-sentry
{
  modules: [
    '@tanakaworld/nuxt-sentry'
  ]
  // able to set options via process.env in runtime
}

// or

{
  modules: [
    '@tanakaworld/nuxt-sentry'
  ],
  sentry: {
    disabled: false
  }
}

Usage

Enter your DSN in nuxt.config.js. Additional config settings can be found here.

Usage in Vue component

In a Vue component, Sentry is available as this.$sentry, so we can call functions like

this.$sentry.captureException(new Error('example'))

where this is a Vue instance.

Options

Options can be passed using either environment variables or sentry section in nuxt.config.js. Normally setting required DSN information would be enough.

dsn

  • Type: String
    • Default: process.env.SENTRY_DSN

disabled

  • Type: Boolean
    • Default: process.env.SENTRY_DISABLED || false

environment

  • Type: String
    • Default: process.env.SENTRY_ENVIRONMENT

release

  • Type: String
    • Default: process.env.SENTRY_RELEASE

License

MIT License

Copyright (c) tanakaworld yutaro.tanaka.world@gmail.com

0.1.1

3 years ago

0.1.0

3 years ago