Socket
Socket
Sign inDemoInstall

rollbar

Package Overview
Dependencies
Maintainers
2
Versions
151
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollbar

Error tracking and logging from JS to Rollbar


Version published
Weekly downloads
382K
decreased by-3.88%
Maintainers
2
Weekly downloads
 
Created

What is rollbar?

Rollbar is a real-time error tracking and monitoring tool for JavaScript applications. It helps developers to detect, diagnose, and fix errors in their applications by providing detailed error reports and notifications.

What are rollbar's main functionalities?

Error Tracking

Rollbar can automatically capture and report uncaught exceptions and unhandled promise rejections. This helps in tracking errors that occur in the application.

const Rollbar = require('rollbar');
const rollbar = new Rollbar({
  accessToken: 'YOUR_ACCESS_TOKEN',
  captureUncaught: true,
  captureUnhandledRejections: true
});

// Example of tracking an error
try {
  throw new Error('Test error');
} catch (e) {
  rollbar.error(e);
}

Custom Logging

Rollbar allows custom logging of messages, warnings, and info messages. This can be useful for tracking specific events or conditions in the application.

const Rollbar = require('rollbar');
const rollbar = new Rollbar({
  accessToken: 'YOUR_ACCESS_TOKEN'
});

// Log a custom message
rollbar.log('Custom log message');

// Log a warning
rollbar.warning('This is a warning');

// Log an info message
rollbar.info('This is an info message');

Telemetry

Rollbar can capture telemetry data such as console logs, network requests, and DOM events. This helps in understanding the context in which an error occurred.

const Rollbar = require('rollbar');
const rollbar = new Rollbar({
  accessToken: 'YOUR_ACCESS_TOKEN',
  captureUncaught: true,
  captureUnhandledRejections: true,
  autoInstrument: true
});

// Example of adding custom telemetry data
rollbar.configure({
  payload: {
    telemetry: [
      { type: 'log', level: 'info', body: 'Custom telemetry data' }
    ]
  }
});

Other packages similar to rollbar

FAQs

Package last updated on 04 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc