Skip to content
A sentry module for Nuxt with nuxt-env
JavaScript Vue
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
__tests__
lib
.gitignore
.npmignore
LICENSE
README.md
jest.config.js
package.json
yarn.lock

README.md

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

You can’t perform that action at this time.