nuxt-sentry
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
- Versions of Nuxt > 1.2.1
- nuxt-env
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
- Default:
disabled
- Type:
Boolean
- Default:
process.env.SENTRY_DISABLED || false
- Default:
environment
- Type:
String
- Default:
process.env.SENTRY_ENVIRONMENT
- Default:
release
- Type:
String
- Default:
process.env.SENTRY_RELEASE
- Default:
License
Copyright (c) tanakaworld yutaro.tanaka.world@gmail.com