{"id":25835973,"url":"https://github.com/bugsplat-git/bugsplat-js","last_synced_at":"2026-03-01T17:07:31.616Z","repository":{"id":21901912,"uuid":"94246957","full_name":"BugSplat-Git/bugsplat-js","owner":"BugSplat-Git","description":"🐛💥🕵️ BugSplat error reporting for modern browsers","archived":false,"fork":false,"pushed_at":"2024-11-27T23:27:34.000Z","size":397,"stargazers_count":5,"open_issues_count":5,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-28T22:51:08.465Z","etag":null,"topics":["callstack","crash","crash-report","error","error-handling","errors","exception","exception-handling","exceptions","stacktrace"],"latest_commit_sha":null,"homepage":"https://docs.bugsplat.com/introduction/getting-started/integrations/web/javascript","language":"TypeScript","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/BugSplat-Git.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-13T18:53:30.000Z","updated_at":"2024-11-27T23:27:36.000Z","dependencies_parsed_at":"2024-03-01T19:50:19.911Z","dependency_job_id":null,"html_url":"https://github.com/BugSplat-Git/bugsplat-js","commit_stats":{"total_commits":89,"total_committers":5,"mean_commits":17.8,"dds":0.1123595505617978,"last_synced_commit":"98a8cd01558d7e06722cfe844c7e15ffc7dacb25"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BugSplat-Git%2Fbugsplat-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BugSplat-Git%2Fbugsplat-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BugSplat-Git%2Fbugsplat-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BugSplat-Git%2Fbugsplat-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BugSplat-Git","download_url":"https://codeload.github.com/BugSplat-Git/bugsplat-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241304302,"owners_count":19941100,"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":["callstack","crash","crash-report","error","error-handling","errors","exception","exception-handling","exceptions","stacktrace"],"created_at":"2025-03-01T01:38:45.348Z","updated_at":"2026-03-01T17:07:31.570Z","avatar_url":"https://github.com/BugSplat-Git.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![bugsplat-github-banner-basic-outline](https://user-images.githubusercontent.com/20464226/149019306-3186103c-5315-4dad-a499-4fd1df408475.png)](https://bugsplat.com)\n\u003cbr/\u003e\n# \u003cdiv align=\"center\"\u003eBugSplat\u003c/div\u003e \n### **\u003cdiv align=\"center\"\u003eCrash and error reporting built for busy developers.\u003c/div\u003e**\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://twitter.com/BugSplatCo\"\u003e\n        \u003cimg alt=\"Follow @bugsplatco on Twitter\" src=\"https://img.shields.io/twitter/follow/bugsplatco?label=Follow%20BugSplat\u0026style=social\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://discord.gg/K4KjjRV5ve\"\u003e\n        \u003cimg alt=\"Join BugSplat on Discord\" src=\"https://img.shields.io/discord/664965194799251487?label=Join%20Discord\u0026logo=Discord\u0026style=social\"\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n## 👋 Introduction\n\nBugSplat-js is a JavaScript error-reporting system for web applications. Before continuing with the tutorial, please make sure you have completed the following checklist:\n* [Sign Up](https://app.bugsplat.com/v2/sign-up) as a new BugSplat user.\n* [Log In](https://app.bugsplat.com/auth0/login) using your email address.\n\n## 🏗 Installation\n\nInstall `bugsplat` via npm. This package currently requires Node.js 18 or later.\n\n```sh\nnpm i bugsplat --save\n```\n\nIf you need to use a version of Node.js older than 18, you can install bugsplat@7.1.4.\n\n## ⚙️ Configuration\n\nDepending on your project's module system, you can either `import` or `require` BugSplat:\n\n### ESM\n```ts\nimport { BugSplat } from 'bugsplat';\n```\n\n### CommonJS\n```ts\nconst { BugSplat } = require('bugsplat');\n```\n\n### Deno\n```ts\nimport { BugSplat } from 'https://esm.sh/bugsplat@8.0.1';\n```\n\nCreate a new instance of the BugSplat class with the name of your BugSplat database, the name of your application and the version of your application:\n```ts\nconst bugsplat = new BugSplat(database, application, version);\n```\n\nListen for `window.onerror` events and post them to BugSplat:\n```ts\nwindow.onerror = async (event, source, lineno, colno, error) =\u003e {\n  await bugsplat.post(error);\n}\n```\n\nAlso listen for `window.unhandledpromiserejection` events and post them to BugSplat:\n```ts\nwindow.onunhandledrejection = async (rejection) =\u003e {\n  await bugsplat.post(rejection.reason)\n}\n```\n\nThrow an exception after the event handler has been added. \n```ts\nthrow new Error('BugSplat!');\n```\n\nYou can use bugsplat-js to capture errors that originate inside of try-catch blocks:\n```ts\ntry {\n    throw new Error('BugSplat');\n} catch(error) {\n    await bugsplat.post(error);\n}\n```\n\nYou can also use bugsplat-js to post errors from promise rejections:\n```ts\nPromise.reject(new Error('BugSplat!')).catch(error =\u003e bugsplat.post(error, {}));\n```\n\n## ✅ Verification\n\nAfter posting an error with bugsplat-js, navigate to the [Crashes](https://app.bugsplat.com/v2/crashes?database=Fred\u0026c0=appName\u0026f0=CONTAINS\u0026v0=my-react-crasher) page. You should see a new crash report for the application you just configured. Click the link in the ID column to see details about your crash on the [Crash](https://app.bugsplat.com/v2/crash?database=Fred\u0026id=94338) page:\n\n![Crashes](https://github.com/BugSplat-Git/bugsplat-js/assets/2646053/ae9acf37-5e1e-4436-9513-4543ad9c16d1)\n![Crash](https://github.com/BugSplat-Git/bugsplat-js/assets/2646053/8338a4db-891d-4ca6-96f6-c3e8222098ae)\n\nThat’s it! Your application is now configured to post crash reports to BugSplat.\n\n## 🧩 API\n\nIn addition to the configuration demonstrated above, there are a few public methods that can be used to customize your BugSplat integration:\n```ts\nbugsplat.setDefaultAppKey(appKey); // Additional metadata that can be queried via BugSplat's web application\nbugsplat.setDefaultUser(user); // The name or id of your user\nbugsplat.setDefaultEmail(email); // The email of your user\nbugsplat.setDefaultDescription(description); // Additional info about your crash that gets reset after every post\nasync bugsplat.post(error, options); // Posts an arbitrary Error object to BugSplat\n// If the values options.appKey, options.user, options.email, options.description are set the corresponding default values will be overwritten\n// Returns a promise that resolves with properties: error (if there was an error posting to BugSplat), response (the response from the BugSplat crash post API), and original (the error passed by bugsplat.post)\n```\n\n## 📢 Upgrading\n\nIf you are developing a Node.js application and were using bugsplat-js \u003c= 5.0.0 please upgrade to [bugsplat-node](https://www.npmjs.com/package/bugsplat-node). BugSplat-node has the same consumer APIs as bugsplat-js \u003c= 5.0.0. Additionally, support for file attachments and exiting the Node process in the error handler have been moved to [bugsplat-node](https://www.npmjs.com/package/bugsplat-node) so that bugsplat-js can be run in browsers as well as Node.js environments.\n\n## 🧑‍💻 Contributing\n\nBugSplat loves open source software! Please check out our project on [GitHub](https://github.com/BugSplat-Git/bugsplat-js) and send us a pull request.\n\n## 👷 Support\n\nIf you have any additional questions, please email or [support](mailto:support@bugsplat.com) team, join us on [Discord](https://discord.gg/K4KjjRV5ve), or reach out via the chat in our web application.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugsplat-git%2Fbugsplat-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbugsplat-git%2Fbugsplat-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugsplat-git%2Fbugsplat-js/lists"}