{"action":"opened","issue":{"url":"https://api.github.com/repos/TestOrgAB/10/issues/18","repository_url":"https://api.github.com/repos/TestOrgAB/10","labels_url":"https://api.github.com/repos/TestOrgAB/10/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/TestOrgAB/10/issues/18/comments","events_url":"https://api.github.com/repos/TestOrgAB/10/issues/18/events","html_url":"https://github.com/TestOrgAB/10/issues/18","id":228697804,"number":18,"title":"Setup Airbrake for your JavaScript application","user":{"login":"shifi","id":2136477,"avatar_url":"https://avatars2.githubusercontent.com/u/2136477?v=3","gravatar_id":"","url":"https://api.github.com/users/shifi","html_url":"https://github.com/shifi","followers_url":"https://api.github.com/users/shifi/followers","following_url":"https://api.github.com/users/shifi/following{/other_user}","gists_url":"https://api.github.com/users/shifi/gists{/gist_id}","starred_url":"https://api.github.com/users/shifi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shifi/subscriptions","organizations_url":"https://api.github.com/users/shifi/orgs","repos_url":"https://api.github.com/users/shifi/repos","events_url":"https://api.github.com/users/shifi/events{/privacy}","received_events_url":"https://api.github.com/users/shifi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-15T12:25:53Z","updated_at":"2017-05-15T12:25:53Z","closed_at":null,"body":"### Installation\n\n#### Using npm\n\n```bash\nnpm install airbrake-js\n```\n\n#### Using bower\n```\nbower install airbrake-js-client\n```\n\n### Setup\nThe notifier is built using a [standalone browserify build](http://www.forbeslindesay.co.uk/post/46324645400/standalone-browserify-builds) and can be used with:\n- [RequireJS](https://github.com/airbrake/airbrake-js/blob/master/examples/requirejs/app.js)\n- [Global/Window](https://github.com/airbrake/airbrake-js/blob/master/examples/legacy/app.js)\n\nWe include the full source code with the package, so you can use [Browserify](https://github.com/airbrake/airbrake-js/blob/master/examples/browserify/app.js) too.\n\nIf you prefer not to host the library yourself, [airbrake-js is available on the excellent cdnjs CDN](https://cdnjs.com/libraries/airbrake-js).\n\n### Basic Usage\n\nFirst you need to initialize the notifier (You can find your project ID and API KEY with your [project's settings](https://me.ab/projects/67/edit)):\n\n```js\n\nvar airbrake = new airbrakeJs.Client({projectId: <Your project ID>, projectKey: '<Your project API KEY>'});\n\n```\nOr if you are using browserify/webpack/etc:\n\n```js\nvar airbrakeJs = require('airbrake-js');\n\nvar airbrake = new airbrakeJs({projectId: <Your project ID>, projectKey: '<Your project API KEY>'});\n\n```\n\nThe simplest method is to report errors directly:\n\n```js\ntry {\n  // This will throw if the document has no head tag\n  document.head.insertBefore(document.createElement('style'));\n} catch(err) {\n  airbrake.notify(err);\n  throw err;\n}\n```\n\nAlternatively you can wrap any code which may throw errors using the client's `wrap` method:\n\n```js\nvar startApp = function() {\n  // This will throw if the document has no head tag.\n  document.head.insertBefore(document.createElement('style'));\n}\nstartApp = airbrake.wrap(startApp);\n\n// Any exceptions thrown in startApp will be reported to Airbrake.\nstartApp();\n```\n\nFor more information please visit our [official GitHub Repo](https://github.com/airbrake/airbrake-js).\n"}}
{"actor":{"display_login":"shifi"}}