0.0.5 • Published 3 years ago

@bugout/humbug v0.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Humbug JavaScript

The Humbug JavaScript library.

Installation

Using npm

npm install --save @bugout/humbug

From source

Clone this repository and enter this directory. Make sure you have node.js installed and then build javascript library from typescript:

npm install 
npm run build

Integrations

Prepare Humbug and fill your token API key:

import Reporter, { HumbugConsent } from "@bugout/humbug"

const BUGOUT_TOKEN = "06a1a299-c6b4-4709-8ac5-650d5e78e53e"

Instantiate the reporter:

const consent = HumbugConsent(true)
const reporter = new Reporter(
    "<name>", 
    consent, 
    "<client_id>", 
    "<session_id>", 
    BUGOUT_TOKEN
)

Unhandled exceptions with process.on

tags = ["app_version"]

process.on('uncaughtException', err => {
    console.error('There was an uncaught error', err)
    reporter.systemReport(tags, true)
    reporter.errorReport(err, tags, true)
})

Your customized exceptions

Add to your PersonalError class errorReport:

class PersonalError extends Error {
    constructor(messsage = "") {
        super(messsage)
        this.name = "PersonalError"
        reporter.errorReport(this, [version], true)
    }
}
0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago