npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jerrbit

v1.0.1

Published

Report client-side, browser events and exceptions to an Errbit or Airbrake service

Downloads

19

Readme

Jerrbit

npm GitHub license

Report client-side, browser events and exceptions to an Errbit or Airbrake service

Usage

var Client = require('jerrbit').Client;

var errbitClient = new Client({
  host: 'http://errbit.your-service.com',
  projectKey: 'ProjectAPIKey',
  context: {
    environment: 'production'
  }
});

try {
  // Your application code here

} catch(error){
  errbitClient.notify(error, {
    context: {
      version: '1.1.1'
    }
  });

  throw(error);
}

Options

Jerrbit.Client requires the following options to configure which Errbit server to use.

  • host: The URL of the Errbit server
  • projectKey: The API key for the project you wish log the errors against

Airbrake Options

Jerrbit supports all of the Airbrake V3 API properties and sets a lot of them for you, but all values can be overwritten if you need.

Field | Required | Supplied by Errbit | Default value is set in | Description ----- | -------- | ------------------ | ----------- | ---------- errors | Yes | Yes | notify | An array of objects describing the error that occurred. errors/{i}/type | Yes| Yes | notify | The class name or type of error that occurred. errors/{i}/message | No | Yes | notify | A short message describing the error that occurred. errors/{i}/backtrace | Yes | Yes | notify | An array of objects describing each line of the error’s backtrace. errors/{i}/backtrace/{i}/file | Yes | Yes | notify | The full path of the file in this entry of the backtrace. errors/{i}/backtrace/{i}/line | No | Yes | notify | The file’s line number in this entry of the backtrace. errors/{i}/backtrace/{i}/column | No | Yes | notify | The line’s column number in this entry of the backtrace. errors/{i}/backtrace/{i}/function | No | Yes | notify | When available, the function or method name in this entry of the backtrace. context | No | No | NA | An object describing additional context for this error. context/notifier| Yes | Yes | N/A | An object describing the notifier client library. context/notifier/name | Yes | Yes | new | The name of the notifier client submitting the request, e.g. “airbrake-js”. context/notifier/version | Yes| Yes | new | The version number of the notifier client submitting the request, e.g. “1.2.3”. context/notifier/url | Yes | Yes | new | A URL at which more information can be obtained concerning the notifier client. context/environment | No | 'development' | new | The name of the server environment in which the error occurred, e.g. “staging”, “production”, etc. context/component | No | No | N/A | The component or module in which the error occurred. In MVC frameworks like Rails, this should be set to the controller. Otherwise, this can be set to a route or other request category. context/action | No | No | N/A | The action in which the error occurred. If each request is routed to a controller action, this should be set here. Otherwise, this can be set to a method or other request subcategory. context/os | No | Yes | new | Details of the operating system on which the error occurred. context/language | No | 'JavaScript' | new | Describe the language on which the error occurred, e.g. “Ruby 2.1.1”. context/version | No | No | | Describe the application version, e.g. “v1.2.3”. context/url | No | Yes | notify | The application’s URL. context/userAgent | No | Yes | new | The requesting browser’s full user-agent string. context/rootDirectory | No | No | N/A | The application’s root directory path. context/user/id | No | No | N/A | If applicable, the current user’s ID. context/user/name | No | No | N/A | If applicable, the current user’s username. context/user/email | No | No | N/A | If applicable, the current user’s email address. environment | No | No | N/A | An object containing the current environment variables. Where the key is the variable name, e.g. { "PORT": "443", "CODE_NAME": "gorilla" }. session | No | Yes | notify | An object containing the current session variables. Where the key is the variable name, e.g. { "basket_total": "1234", "user_id": "123" }. params | No | Yes | notify | An object containing the request parameters. Where the key is the parameter name, e.g. { "page": "3", "sort": "desc" }.

Overwriting the default context values

You can overwrite the default values by either specifying them when instantiating Client or when calling notify. Values that are not expected to change over the course of your application should be specified when instantiating Client.

var errbitClient = new Client({
  host: 'http://errbit.your-service.com',
  projectKey: 'ProjectAPIKey',
  context: {
    environment: 'production',
    language: 'JavaScript & XML'
  }
});

Those values that can change should be set using notify. These values must be specified each time notify is called or they may be overwritten with the default values.

errbitClient.notify(error, {
  context: {
    user: window.user
  }
});