3.0.4 • Published 6 years ago

bug-monitor-client v3.0.4

Weekly downloads
6
License
AGPL-3.0
Repository
github
Last release
6 years ago

Bug Monitor Client

This script will help you track your JS errors in production.

It is a commonJS module that tracks errors in your code and sends them to a url for you to collect.

Minimum Setup

import { BugMonitorClient } from 'bug-monitor-client';

bmc: BugMonitorClient = new BugMonitorClient({
  bugMonitorUrl: 'https://your-back-end.io',
  clientName: 'your project name'
});

Options

* = requried

PropertyDefaultTypeDescription
bugMonitorUrl*""stringURL the script is sending to
clientName*""stringName of the project
customFields{}string, [], boolean, objectA custom field that will be sent with the request
disabledfalsebooleancan be used to disable logging in development environments
httpMethod'POST'stringHTTP method
timeout2000number in millisecondsThis is a timeout for the xhr request to the back-end your sending to
verbosetruebooleanSet this to false and bug-monitor-client will only report errors

Sent Data

Data that will be sent to the collecting endpoint when an error in your JS occurs:

{
  'clientName': '',
  'column': 1,
  'customFields': {},
  'filename': '',
  'innerHeight': 2,
  'innerWidth': 3,
  'language': '',
  'line': 4,
  'message': '',
  'stack': '',
  'userAgent': ''
}

Custom Fields

Send your own data with custom fields:

bmc = new BugMonitorClient({
  bugMonitorUrl: 'https://your-back-end.io',
  clientName: 'your project name',
  customFields: {
    'string': 'foo',
    'object': {foobar: 'barfoo'},
    'array': [0, 1]
  }
});

Browser Support

Desktop

  • Chrome
  • Edge
  • Firefox
  • Internet Explorer >= 9
  • Safari

Mobile

  • Android Chrome 6
  • iOS Safari 4
3.0.4

6 years ago

3.0.3

6 years ago

3.0.0

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago

0.5.0

7 years ago

0.4.0

7 years ago