https://github.com/gaelreyrol/nuxt-rollbar-module
Nuxt.js module for Rollbar
https://github.com/gaelreyrol/nuxt-rollbar-module
nuxt-module nuxtjs rollbar
Last synced: 2 months ago
JSON representation
Nuxt.js module for Rollbar
- Host: GitHub
- URL: https://github.com/gaelreyrol/nuxt-rollbar-module
- Owner: gaelreyrol
- License: mit
- Archived: true
- Created: 2018-09-06T15:57:13.000Z (almost 7 years ago)
- Default Branch: develop
- Last Pushed: 2023-02-21T22:51:23.000Z (over 2 years ago)
- Last Synced: 2025-02-10T00:41:34.976Z (4 months ago)
- Topics: nuxt-module, nuxtjs, rollbar
- Language: JavaScript
- Homepage:
- Size: 1010 KB
- Stars: 35
- Watchers: 2
- Forks: 9
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nuxt-rollbar-module
[](https://npmjs.com/package/nuxt-rollbar-module)
[](https://npmjs.com/package/nuxt-rollbar-module)
[](https://circleci.com/gh/gaelreyrol/nuxt-rollbar-module)
[](https://codecov.io/gh/gaelreyrol/nuxt-rollbar-module)
[](https://david-dm.org/gaelreyrol/nuxt-rollbar-module)
[](http://standardjs.com)> Rollbar module for NuxtJS
## Setup
- Add `nuxt-rollbar-module` dependency using yarn or npm to your project
```shell
npm install --save nuxt-rollbar-module
yarn add nuxt-rollbar-module
```- Add `nuxt-rollbar-module` to `modules` section of `nuxt.config.js`
```js
{
modules: [
// Simple usage
'nuxt-rollbar-module',// With options
[
'nuxt-rollbar-module',
{
serverAccessToken: 'YOUR_ROLLBAR_SERVER_TOKEN',
clientAccessToken: 'YOUR_ROLLBAR_CLIENT_TOKEN',
config: {
// Addtional config
}
}
]
]
}
```## Usage
Enter your project access tokens in the NuxtJS config file.
See [Rollbar javascript documentation](https://rollbar.com/docs/notifier/rollbar.js/) for options.### Usage in Vue.js
```js
Vue.rollbar.debug('Yohyo!')
// or in a vue component
this.$rollbar.debug('Yohyo!')
```### Usage in Nuxt.js
```js
export default {
asyncData(context) {
// called by only server side
context.$rollbar.debug('Yohyo!')
},created() {
// called by both server side and client side
this.$rollbar.debug('Yohyo!')if (process.server) {
this.$rollbar.debug('from server side')
}if (process.client) {
this.$rollbar.debug('from client side')
}
},mounted() {
// called by only client side
this.$rollbar.debug('Yohyo!')
}
}
```## Options
## Development
- Clone this repository
- Install dependencies using `yarn install` or `npm install`
- Start development server using `npm run dev`## License
[MIT License](./LICENSE)
Copyright (c) Gaël Reyrol