Giter VIP home page Giter VIP logo

nuxt-rollbar-module's Introduction

nuxt-rollbar-module

npm (scoped with tag) npm 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: {
          // Additional 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 npm ci
  • Start development server using npm run dev

License

MIT License

Copyright (c) Gaël Reyrol [email protected]

nuxt-rollbar-module's People

Contributors

argeento avatar dependabot[bot] avatar gaelreyrol avatar ryonkmr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.