Backtrace provides an open-source module which you can use to capture uncaught Javascript errors, as well as to manually send reports.
Download and Documentation
backtrace-js
download and full documentation is available at https://github.com/backtrace-labs/backtrace-js
Example Usage
// Import backtrace-js with your favorite package manager.
import * as bt from 'backtrace-js'
bt.initialize({
endpoint: "https://yourcompany.sp.backtrace.io:6098",
token: "51cc8e69c5b62fa8c72dc963e730f1e8eacbd243aeafc35d08d05ded9a024121",
})
// Later, when you have an error:
bt.report(new Error("something broke"));
Testing
npm install
./node_modules/.bin/browserify test/app.js --outfile test/out.js
node test/server.js