What is bugsnag-build-reporter?
The `bugsnag-build-reporter` npm package is used to report build information to Bugsnag. This can help in tracking which builds are affected by specific errors and in correlating errors with specific code changes.
What are bugsnag-build-reporter's main functionalities?
Reporting a build
This feature allows you to report a build to Bugsnag. You need to provide your Bugsnag API key, the app version, release stage, builder name, and source control information. The function returns a promise that resolves when the build is reported successfully.
const reportBuild = require('bugsnag-build-reporter');
const options = {
apiKey: 'YOUR_BUGSNAG_API_KEY',
appVersion: '1.2.3',
releaseStage: 'production',
builderName: 'Jenkins',
sourceControl: {
provider: 'github',
repository: 'https://github.com/your/repo',
revision: 'abc123'
}
};
reportBuild(options).then(() => {
console.log('Build reported successfully');
}).catch(err => {
console.error('Failed to report build', err);
});
Other packages similar to bugsnag-build-reporter
sentry-cli
The `sentry-cli` package is a command-line tool for Sentry, a popular error tracking service. It allows you to manage releases, upload source maps, and report deploys. Compared to `bugsnag-build-reporter`, `sentry-cli` offers a broader range of functionalities including source map uploads and release management.
rollbar
The `rollbar` package is a client for Rollbar, another error tracking service. It provides functionalities for reporting errors, managing deployments, and tracking builds. Similar to `bugsnag-build-reporter`, it allows you to report build information but also includes more comprehensive error tracking features.
bugsnag-build-reporter
A tool for reporting your application's builds to Bugsnag.
Usage
This module can be used in a Node environment via the JS API or as a CLI.
CLI
Install globally with npm i -g bugsnag-build-reporter
or locally as a dev dependency npm i -D bugsnag-build-reporter
. If installed via the latter, recent versions of npm come with a tool called npx
which will help run it without typing burdensome paths.
A tool for reporting your application's builds to Bugsnag
Usage
$ bugsnag-build-reporter <flags> <metadata>
Options
--api-key, -k Set your notifier API key [required]
--app-version, -v Set the app version [required]
--release-stage, -s Set the release stage
--source-control-provider, -p Set the repo provider
--source-control-repository, -r Set the repo URL
--source-control-revision, -e Set the source control revision id (e.g commit SHA)
--app-version-code, -c Set the version code (Android only)
--app-bundle-version, -b Set the bundle version (iOS/macOS/tvOS only)
--builder-name, -n Set the name of the entity that triggered the build
metadata
Arbitrary "key=value" pairs will be passed to the build API as metadata
e.g. foo=bar
Examples
bugsnag-build-reporter \
--api-key cc814aead128d38d0767094327b4784a \
--app-version 1.3.5
bugsnag-build-reporter \
-k cc814aead128d38d0767094327b4784a \
-v 1.3.5
npm scripts
scripts: {
'report-build': 'bugsnag-build-reporter -k YOUR_API_KEY -v APP_VERSION'
}
JS API
const reportBuild = require('bugsnag-build-reporter')
reportBuild({
apiKey: 'YOUR_API_KEY',
appVersion: '1.2.3',
})