Installation

Install the Rollbar rollbar.js package using npm:

$ npm install --save rollbar

Send a Message to Rollbar

// include and initialize the rollbar library with your access token
var Rollbar = require("rollbar");
var rollbar = new Rollbar("{{ server_access_token }}");

// record a generic message and send it to Rollbar
rollbar.log("Hello world!");

The message should appear in your Rollbar dashboard within a few seconds.

Once you've verified you have the Rollbar package installed, your access token works, and you can connect to Rollbar, the rollbar.js documentation can show you how to automatically report exceptions and log messages to Rollbar.