Note: This repository has been moved to @honeybadger-io/js, home to all Honeybadger's JavaScript packages.
For comprehensive documentation and support, check out our documentation site.
The documentation includes a detailed React integration guide
The goal is to provide an idiomatic, simple integration of Honeybadger's exception monitoring service with React.js applications.
This version is considered suitable for preview.
Honeybadger-react hooks in to the error handler in React. This means we only notify Honeybadger of React context for errors that React handles. Some errors inside React code may propagate to the window onerror handler instead.
In those cases, Honeybadger Javascript library's default error notifier is invoked, which will contain a stack trace but none of the React variables.
This project is built using create-react-library with rollup and generates artifacts in commonjs, esm and umd formats. It's possible your own build environment may be just different enough to require some adjustments. If you find that our artifacts don't quite meet your needs, please file an issue on GitHub.
There's a minimal implementation of a honeybadger-react integration in the ./example folder. If you want to contribute a patch to honeybadger-react, it can be useful to have the demo app running.
To run it, issue these commands from your shell:
cd example
npm install
REACT_APP_HONEYBADGER_API_KEY=b425b636 npm run start
This will serve the demo app with hot reload at localhost:3000
For a detailed explanation on how hot reloading works, check out the documentation.
See https://github.com/honeybadger-io/honeybadger-react/blob/master/CHANGELOG.md Changelog is automatically generated with our release automation process.
- Fork it.
- Create a topic branch
git checkout -b my_branch
- Commit your changes
git commit -am "Boom"
- Push to your branch
git push origin my_branch
- Send a pull request
# install dependencies
npm install
# build for production
npm run build
# run unit tests
npm test
# automatically continuously rebuild the dist/ artifacts with hot reload when developing
npm run start
- With a clean working tree, use
npm version [new version]
to bump the version, commit the changes, tag the release, and push to GitHub. Seenpm help version
for documentation. - To publish the release, use
npm publish
. Seenpm help publish
for documentation.
We use Ship.js to automate releasing.
Ship.js creates a PR once per week when unreleased changes are present. You can also trigger a release PR by saying "@shipjs prepare" in any issue or pull request comment on GitHub.
If a ship.js release fails, you need to revert the release commit and delete the release branch (e.g releases/v1.1.0
)
Then, you can debug the issue by simulating the release process locally (npm run release -- --dry-run --yes --no-browse
).
honeybadger-react is MIT licensed. See the LICENSE file in this repository for details.