- Add
nuxt-bugsnag
dependency to your project
npm install nuxt-bugsnag
- Add
nuxt-bugsnag
to themodules
section ofnuxt.config.js
.
{
modules: [
'nuxt-bugsnag'
]
}
You can pass every bugsnag options in the config object
{
bugsnag: {
config: {
apiKey: 'your key',
enabledReleaseStages: ['staging', 'production'],
}
}
}
You can upload sourcemaps by adding the option publishRelease
.
{
bugsnag: {
config: {
publishRelease: true,
}
}
}
I would recommend to set these options
{
modules: [
'nuxt-bugsnag',
],
bugsnag: {
publishRelease: true,
config: {
apiKey: 'YOUR_API_KEY',
enabledReleaseStages: ['staging', 'production'],
releaseStage: process.env.NODE_ENV
appVersion: 'YOUR_VERSION',
}
}
}
The simplest answer is like this.
this.$bugsnag.notify(new Error('Some Error'))
if you like the composition approach you can do it like this
useBugsnag().notify('Some Error')
- Clone this repository
- Install dependencies using
npm install
- Start development server using
npm run dev
Copyright (c) Julian Martin [email protected]