https://github.com/tanakaworld/nuxt-sentry
A sentry module for Nuxt with nuxt-env
https://github.com/tanakaworld/nuxt-sentry
Last synced: 4 months ago
JSON representation
A sentry module for Nuxt with nuxt-env
- Host: GitHub
- URL: https://github.com/tanakaworld/nuxt-sentry
- Owner: tanakaworld
- License: mit
- Archived: true
- Created: 2018-12-02T10:17:00.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-18T23:41:18.000Z (over 4 years ago)
- Last Synced: 2025-01-22T18:56:26.399Z (5 months ago)
- Language: JavaScript
- Size: 136 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nuxt-sentry
[](https://circleci.com/gh/tanakaworld/nuxt-sentry)
[](https://npmjs.com/package/@tanakaworld/nuxt-sentry)> A sentry module for Nuxt with nuxt-env
## ⚠️ This package has been archived
Nuxt v2.13 has introduced runtime config which provides us the ability to configure environment variables dynamically. Please use it.
- https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-runtime-config/
- https://nuxtjs.org/blog/moving-from-nuxtjs-dotenv-to-runtime-config/## Features
The module enables error logging through [Sentry](http://sentry.io).
nuxt-env is supported, so you can set DSN via runtime environment.
## Dependencies
- Versions of Nuxt > 1.2.1
- [nuxt-env](https://github.com/samtgarson/nuxt-env)## Get Started
```bash
$ npm i -S @tanakaworld/nuxt-sentry
# or
$ yarn add @tanakaworld/nuxt-sentry
``````js
{
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](https://docs.sentry.io/clients/javascript/config/).
### 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](./LICENSE)
Copyright (c) tanakaworld