Sentry module for Nuxt.js
The module enables error logging through Sentry.
@nuxtjs/sentry dependency using yarn or npm to your project@nuxtjs/sentry to modules section of nuxt.config.js{
modules: [
'@nuxtjs/sentry',
],
sentry: {
public_key: '',
private_key: '',
project_id: '',
config: {
// Additional config
},
}
}
Make sure you use a version of Nuxt either prior to v1.0.0 or after v1.2.1.
Enter your DSN in the NuxtJS config file. Additional config settings can be found here.
In a Vue component, Raven is available as this.$raven, so we can call functions like
this.$raven.setUserContext({user})
where this is a Vue instance.
Options can be passed using either environment variables or sentry section in nuxt.config.js.
Normally setting required DSN information would be enough.
String
process.env.SENTRY_DSNString
process.env.SENTRY_PUBLIC_DSNIf value omitted it will be generated using dsn value, by removing private key part.
String
process.env.SENTRY_PUBLIC_KEYWill be ignored if dsn provided.
String
process.env.SENTRY_PRIVATE_KEYWill be ignored if dsn provided.
String
process.env.SENTRY_HOST || 'sentry.io'Will be ignored if dsn provided.
String
process.env.SENTRY_PROTOCOL || 'https'Will be ignored if dsn provided.
String
process.env.SENTRY_PROJECT_ID || ''Will be ignored if dsn provided.
String
process.env.SENTRY_PATH || '/'Will be ignored if dsn provided.
Boolean
process.env.SENTRY_DISABLED || falseBoolean
process.env.SENTRY_DISABLE_CLIENT_SIDE || falseCopyright © Diederik van den Burger diederik@webrelated.nl
We use cookies
We use cookies to analyze traffic and improve your experience. You can accept or reject analytics cookies.