Documentation

Check out our guides and API reference documentation on how to use Rollbar to monitor, debug, and triage errors.

Guides & SDKs    API Reference

Integration with rollbar.js

In case you want to report your JavaScript errors using Rollbar.js, you can configure the gem to enable Rollbar.js on your site. Example:

Rollbar.configure do |config|
  # common gem configuration
  # ...
  config.js_enabled = true
  config.js_options = {
    accessToken: "POST_CLIENT_ITEM_ACCESS_TOKEN",
    captureUncaught: true,
    payload: {
      environment: "production"
    }
  }
end

The Hash passed to #js_options= should have the same available options that you can find in Rollbar.js, using symbols or strings for the keys.

Options that take a function, such as checkIgnore or transform, can be wrapped using Rollbar::JSON::Value. Example:

Rollbar.configure do |config|
  config.js_enabled = true
  config.js_options = {
    accessToken: "POST_CLIENT_ITEM_ACCESS_TOKEN",
    checkIgnore: Rollbar::JSON::Value.new('function(isUncaught, args, payload){}')
  }
end

πŸ“˜

For more information on rollbar-gem, please see the docs here.

Updated 2 years ago


Integration with rollbar.js


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.