{"id":18368764,"url":"https://github.com/greena13/jerrbit","last_synced_at":"2025-04-10T19:38:29.653Z","repository":{"id":57151303,"uuid":"49600124","full_name":"greena13/jerrbit","owner":"greena13","description":"Report client-side, browser events and exceptions to an Errbit or Airbrake service","archived":false,"fork":false,"pushed_at":"2018-10-01T07:59:59.000Z","size":53,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T08:35:48.845Z","etag":null,"topics":["airbrake","errbit","javascript"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/greena13.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-13T20:33:48.000Z","updated_at":"2019-01-13T14:25:21.000Z","dependencies_parsed_at":"2022-08-31T20:02:22.750Z","dependency_job_id":null,"html_url":"https://github.com/greena13/jerrbit","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greena13%2Fjerrbit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greena13%2Fjerrbit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greena13%2Fjerrbit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greena13%2Fjerrbit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greena13","download_url":"https://codeload.github.com/greena13/jerrbit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248281427,"owners_count":21077423,"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":["airbrake","errbit","javascript"],"created_at":"2024-11-05T23:27:21.163Z","updated_at":"2025-04-10T19:38:29.633Z","avatar_url":"https://github.com/greena13.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jerrbit\n\n[![npm](https://img.shields.io/npm/dm/jerrbit.svg)]()\n[![GitHub license](https://img.shields.io/github/license/greena13/jerrbit.svg)](https://github.com/greena13/jerrbit/blob/master/LICENSE)\n\nReport client-side, browser events and exceptions to an Errbit or Airbrake service\n\n## Usage\n\n```javascript\nvar Client = require('jerrbit').Client;\n\nvar errbitClient = new Client({\n  host: 'http://errbit.your-service.com',\n  projectKey: 'ProjectAPIKey',\n  context: {\n    environment: 'production'\n  }\n});\n\ntry {\n  // Your application code here\n\n} catch(error){\n  errbitClient.notify(error, {\n    context: {\n      version: '1.1.1'\n    }\n  });\n\n  throw(error);\n}\n```\n\n## Options\n\n`Jerrbit.Client` requires the following options to configure which Errbit server to use.\n\n- `host`: The URL of the Errbit server\n- `projectKey`: The API key for the project you wish log the errors against\n\n\n### Airbrake Options\n\nJerrbit supports all of the [Airbrake V3 API properties](https://airbrake.io/docs/#create-notice-v3) and sets a lot of them for you, but all values can be overwritten if you need.\n\nField | Required | Supplied by Errbit | Default value is set in | Description\n----- | -------- | ------------------ | ----------- | ----------\n`errors` | Yes | Yes | `notify` | An array of objects describing the error that occurred.\n`errors/{i}/type` | Yes| Yes | `notify` |  The class name or type of error that occurred.\n`errors/{i}/message` | No | Yes | `notify` | A short message describing the error that occurred.\n`errors/{i}/backtrace` | Yes | Yes | `notify` | An array of objects describing each line of the error’s backtrace.\n`errors/{i}/backtrace/{i}/file` | Yes | Yes | `notify` | The full path of the file in this entry of the backtrace.\n`errors/{i}/backtrace/{i}/line` | No | Yes | `notify` | The file’s line number in this entry of the backtrace.\n`errors/{i}/backtrace/{i}/column` | No | Yes | `notify` | The line’s column number in this entry of the backtrace.\n`errors/{i}/backtrace/{i}/function` | No | Yes | `notify` | When available, the function or method name in this entry of the backtrace.\n`context` | No | No | NA | An object describing additional context for this error.\n`context/notifier`| Yes | Yes | N/A | An object describing the notifier client library.\n`context/notifier/name` | Yes | Yes | `new` | The name of the notifier client submitting the request, e.g. “airbrake-js”.\n`context/notifier/version` | Yes| Yes | `new` | The version number of the notifier client submitting the request, e.g. “1.2.3”.\n`context/notifier/url` | Yes | Yes | `new` | A URL at which more information can be obtained concerning the notifier client.\n`context/environment` | No | 'development' | `new` |  The name of the server environment in which the error occurred, e.g. “staging”, “production”, etc.\n`context/component` | No | No | N/A | The component or module in which the error occurred. In MVC frameworks like Rails, this should be set to the controller. Otherwise, this can be set to a route or other request category.\n`context/action` | No | No | N/A | The action in which the error occurred. If each request is routed to a controller action, this should be set here. Otherwise, this can be set to a method or other request subcategory.\n`context/os` | No | Yes | `new` | Details of the operating system on which the error occurred.\n`context/language` | No | 'JavaScript' | `new` | Describe the language on which the error occurred, e.g. “Ruby 2.1.1”.\n`context/version` | No | No |  | Describe the application version, e.g. “v1.2.3”.\n`context/url` | No | Yes | `notify` | The application’s URL.\n`context/userAgent` | No | Yes | `new` | The requesting browser’s full user-agent string.\n`context/rootDirectory` | No | No | N/A | The application’s root directory path.\n`context/user/id` | No | No | N/A | If applicable, the current user’s ID.\n`context/user/name` | No | No | N/A | If applicable, the current user’s username.\n`context/user/email` | No | No | N/A | If applicable, the current user’s email address.\n`environment` | No | No | N/A | An object containing the current environment variables. Where the key is the variable name, e.g. { \"PORT\": \"443\", \"CODE_NAME\": \"gorilla\" }.\n`session` | No | Yes | `notify` | An object containing the current session variables. Where the key is the variable name, e.g. { \"basket_total\": \"1234\", \"user_id\": \"123\" }.\n`params` | No | Yes | `notify` | An object containing the request parameters. Where the key is the parameter name, e.g. { \"page\": \"3\", \"sort\": \"desc\" }.\n\n### Overwriting the default context values\n\nYou can overwrite the default values by either specifying them when instantiating `Client` or when calling `notify`. Values that are not expected to change over the course of your application should be specified when instantiating `Client`.\n\n```javascript\nvar errbitClient = new Client({\n  host: 'http://errbit.your-service.com',\n  projectKey: 'ProjectAPIKey',\n  context: {\n    environment: 'production',\n    language: 'JavaScript \u0026 XML'\n  }\n});\n```\n\nThose values that can change should be set using `notify`. These values must be specified each time `notify` is called or they may be overwritten with the default values.\n\n```javascript\nerrbitClient.notify(error, {\n  context: {\n    user: window.user\n  }\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreena13%2Fjerrbit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreena13%2Fjerrbit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreena13%2Fjerrbit/lists"}