{"id":21893765,"url":"https://github.com/goodwaygroup/lib-hapi-rollbar","last_synced_at":"2025-07-04T07:35:58.313Z","repository":{"id":32458967,"uuid":"133839424","full_name":"GoodwayGroup/lib-hapi-rollbar","owner":"GoodwayGroup","description":"Hapi v17+ plugin for Rollbar notifications","archived":false,"fork":false,"pushed_at":"2025-05-17T16:00:42.000Z","size":467,"stargazers_count":3,"open_issues_count":3,"forks_count":0,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-07-04T04:51:19.940Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GoodwayGroup.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-05-17T16:16:48.000Z","updated_at":"2024-01-08T19:50:35.000Z","dependencies_parsed_at":"2023-12-16T04:33:45.420Z","dependency_job_id":"83709cab-365c-4c10-a308-b2d4f8af628c","html_url":"https://github.com/GoodwayGroup/lib-hapi-rollbar","commit_stats":{"total_commits":100,"total_committers":7,"mean_commits":"14.285714285714286","dds":0.5700000000000001,"last_synced_commit":"8382c01deedb2089b02dd6364187a2a93f4c4b7c"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/GoodwayGroup/lib-hapi-rollbar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodwayGroup%2Flib-hapi-rollbar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodwayGroup%2Flib-hapi-rollbar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodwayGroup%2Flib-hapi-rollbar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodwayGroup%2Flib-hapi-rollbar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GoodwayGroup","download_url":"https://codeload.github.com/GoodwayGroup/lib-hapi-rollbar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodwayGroup%2Flib-hapi-rollbar/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263469763,"owners_count":23471595,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-28T13:16:38.092Z","updated_at":"2025-07-04T07:35:58.278Z","avatar_url":"https://github.com/GoodwayGroup.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @goodwaygroup/lib-hapi-rollbar\n\n[![CircleCI](https://circleci.com/gh/GoodwayGroup/lib-hapi-rollbar.svg?style=svg)](https://circleci.com/gh/GoodwayGroup/lib-hapi-rollbar)\n[![Coverage Status](https://coveralls.io/repos/github/GoodwayGroup/lib-hapi-rollbar/badge.svg?branch=master)](https://coveralls.io/github/GoodwayGroup/lib-hapi-rollbar?branch=master)\n[![npm downloads](https://img.shields.io/npm/dm/@goodwaygroup/lib-hapi-rollbar.svg?style=flat-square)](http://npm-stat.com/charts.html?package=@goodwaygroup/lib-hapi-rollbar)\n[![install size](https://packagephobia.com/badge?p=@goodwaygroup/lib-hapi-rollbar)](https://packagephobia.com/result?p=@goodwaygroup/lib-hapi-rollbar)\n\n\u003e Please do not run this plugin within tests in your application\n\n## Usage\n\nThis plugin will push exceptions to Rollbar.\n\n```\n$ npm install -S @goodwaygroup/lib-hapi-rollbar\n```\n\nIn your `index.js` for the Hapi server, register the plugin:\n\n```js\n// Rollbar\nif (process.env.ROLLBAR_TOKEN \u0026\u0026 ['production', 'staging'].indexOf(process.env.NODE_ENV) \u003e -1) {\n    await server.register({\n        plugin: require('@goodwaygroup/lib-hapi-rollbar'), // eslint-disable-line global-require\n        options: {\n            accessToken: process.env.ROLLBAR_TOKEN,\n            captureEmail: true,\n            captureUncaught: true,\n            captureUnhandledRejections: true,\n            omittedResponseCodes: [400, 401, 404, 409],\n            codeVersion: require('../package.json').version // eslint-disable-line global-require\n        }\n    });\n} else {\n    // passthru helper method to clean up code when rollbar is not configured\n    server.decorate('request', 'sendRollbarMessage', () =\u003e {});\n}\n```\n\n## Configuration Options\n\n\u003e When passing a configuration option, it will overwrite the defaults.\n\nYou can pass in any configuration option for the [Rollbar](https://github.com/rollbar/rollbar.js) library.\n\nCustom options:\n\n- `omittedResponseCodes`: An `ARRAY` of HTTP codes (as integers) to not report to Rollbar.\n    - Defaults to `[]`, but we recommend `[400, 401, 404, 409]` to avoid spam exceptions.\n\n### Person Tracking\n\nThe plugin uses the standard [Person Tracking](https://docs.rollbar.com/docs/person-tracking) features. To ensure you are passing the correct info to Rollbar, place the data you want to track in the `request.auth.credentials` object. This will be copied to `request.rollbar_person` when pushing the exception to Rollbar.\n\n### Send Custom Message\n\nYou can send custom messages to Rollbar via the `request.sendRollbarMessage` decorator. It will default to the `error` level. You use any Rollbar supported level:\n\n```\ndebug\ninfo\nwarning\nerror\ncritical\n```\n\nExample call:\n\n```js\nrequest.sendRollbarMessage({\n    level: 'warning', // defaults to 'error'\n    message: 'Custom Message',\n    payload: { custom: { payload: 'data' } }\n})\n```\n\n### Send Custom object\n\nRollbar allows a custom object to be passed through and sent in the payload delivered to a Rollbar occurence (see [here](https://docs.rollbar.com/docs/nodejs#section-caught-exceptions)). In `lib-hapi-rollbar`, we couple this to Boom such that any data passed in as an argument to a Boom error will be delivered through to Rollbar. For example, `Boom.badImplementation('message', data)` will result in the contents of `data` landing as part of the Rollbar occurence report.\n\n## Running Tests\n\nTo run tests, just run the following:\n\n```\nnpm test\n```\n\nAll commits are tested on [CircleCI](https://circleci.com/gh/GoodwayGroup/workflows/lib-hapi-rollbar)\n\n## Linting\n\nTo run `eslint`:\n\n```\nnpm run lint\n```\n\nTo auto-resolve:\n\n```\nnpm run lint:fix\n```\n\n## Contributing\n\nPlease read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## Versioning\n\nWe use milestones and `npm` version to bump versions. We also employ [git-chglog](https://github.com/git-chglog/git-chglog) to manage the [CHANGELOG.md](CHANGELOG.md). For the versions available, see the [tags on this repository](https://github.com/GoodwayGroup/lib-hapi-rollbar/tags).\n\nTo initiate a version change:\n\n```\nnpm version major|minor|patch\n```\n\n## Authors\n\n* **Derek Smith** - *Initial work* - [@clok](https://github.com/clok)\n\nSee also the list of [contributors](https://github.com/GoodwayGroup/lib-hapi-rollbar/contributors) who participated in this project.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n\n## Acknowledgments\n\n* [yayuhh](https://github.com/yayuhh) and their work on [icecreambar](https://github.com/yayuhh/icecreambar)\n\n## Sponsors\n\n[![goodwaygroup][goodwaygroup]](https://goodwaygroup.com)\n\n[goodwaygroup]: https://s3.amazonaws.com/gw-crs-assets/goodwaygroup/logos/ggLogo_sm.png \"Goodway Group\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoodwaygroup%2Flib-hapi-rollbar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoodwaygroup%2Flib-hapi-rollbar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoodwaygroup%2Flib-hapi-rollbar/lists"}