
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
BugSplat-js is a JavaScript error reporting system for web applications. Before continuing with the tutorial please make sure you have completed the following checklist:
Install bugsplat
via npm. This package currently requires Node.js 18 or later.
npm i bugsplat --save
If you need to use a version of Node.js that's older than 18, you can install bugsplat@7.1.4.
Depending on your project's module system you can either import
or require
BugSplat:
import { BugSplat } from 'bugsplat';
const { BugSplat } = require('bugsplat');
Create a new instance of the BugSplat class with the name of your BugSplat database, the name of your application and the version of your application:
const bugsplat = new BugSplat(database, application, version);
Listen for window.onerror
events and post them to BugSplat:
window.onerror = async (event, source, lineno, colno, error) => {
await bugsplat.post(error);
}
Also listen for window.unhandledpromiserejection
events and post them to BugSplat:
window.onunhandledrejection = async (rejection) => {
await bugsplat.post(rejection.reason)
}
Throw an exception after the event handler has been added.
throw new Error('BugSplat!');
You can use bugsplat-js to capture errors that originate inside of try-catch blocks:
try {
throw new Error('BugSplat');
} catch(error) {
await bugsplat.post(error);
}
You can also use bugsplat-js to post errors from promise rejections:
Promise.reject(new Error('BugSplat!')).catch(error => bugsplat.post(error, {}));
After posting an error with bugsplat-js, navigate to the Crashes page. You should see a new crash report for the application you just configured. Click the link in the ID column to see details about your crash on the Crash page:
That’s it! Your application is now configured to post crash reports to BugSplat.
In addition to the configuration demonstrated above, there are a few public methods that can be used to customize your BugSplat integration:
bugsplat.setDefaultAppKey(appKey); // Additional metadata that can be queried via BugSplat's web application
bugsplat.setDefaultUser(user); // The name or id of your user
bugsplat.setDefaultEmail(email); // The email of your user
bugsplat.setDefaultDescription(description); // Additional info about your crash that gets reset after every post
async bugsplat.post(error, options); // Posts an arbitrary Error object to BugSplat
// If the values options.appKey, options.user, options.email, options.description are set the corresponding default values will be overwritten
// Returns a promise that resolves with properties: error (if there was an error posting to BugSplat), response (the response from the BugSplat crash post API), and original (the error passed by bugsplat.post)
If you are developing a Node.js application and were using bugsplat-js <= 5.0.0 please upgrade to bugsplat-node. BugSplat-node has the same consumer APIs as bugsplat-js <= 5.0.0. Additionally, support for file attachments and exiting the Node process in the error handler have been moved to bugsplat-node so that bugsplat-js can be run in browsers as well as Node.js environments.
BugSplat loves open source software! Please check out our project on GitHub and send us a pull request.
If you have any additional questions, please email or support team, join us on Discord, or reach out via the chat in our web application.
FAQs
error reporting for js
The npm package bugsplat receives a total of 92 weekly downloads. As such, bugsplat popularity was classified as not popular.
We found that bugsplat demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.