This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

nuxt-rollbar-module

1.1.0 • Public • Published

nuxt-rollbar-module

npm (scoped with tag) npm CircleCI Codecov Dependencies js-standard-style

Rollbar module for NuxtJS

Setup

  • Add nuxt-rollbar-module dependency using yarn or npm to your project
npm install --save nuxt-rollbar-module
yarn add nuxt-rollbar-module
  • Add nuxt-rollbar-module to modules section of nuxt.config.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 for options.

Usage in Vue.js

Vue.rollbar.debug('Yohyo!')
// or in a vue component
this.$rollbar.debug('Yohyo!')

Usage in Nuxt.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

Copyright (c) Gaël Reyrol me@gaelreyrol.com

Readme

Keywords

none

Package Sidebar

Install

npm i nuxt-rollbar-module

Weekly Downloads

726

Version

1.1.0

License

MIT

Unpacked Size

7.66 kB

Total Files

5

Last publish

Collaborators

  • zevran