{"id":25836013,"url":"https://github.com/bugsplat-git/bugsplat-js-api-client","last_synced_at":"2026-05-06T01:04:19.470Z","repository":{"id":38172976,"uuid":"370837301","full_name":"BugSplat-Git/bugsplat-js-api-client","owner":"BugSplat-Git","description":"⚙️🧩🧑‍💻 TS/JS client for consuming BugSplat APIs","archived":false,"fork":false,"pushed_at":"2025-01-30T00:49:05.000Z","size":1443,"stargazers_count":8,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-30T00:51:07.168Z","etag":null,"topics":["api","apm","bugsplat","client","crash","error","javascript","reporting","typescript"],"latest_commit_sha":null,"homepage":"https://docs.bugsplat.com/introduction/development/web-services/api","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":"CHANGELOG.md","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":"2021-05-25T21:55:20.000Z","updated_at":"2025-01-30T00:49:08.000Z","dependencies_parsed_at":"2022-09-02T10:51:54.533Z","dependency_job_id":"cac38bde-1924-484d-a898-3e80a82b4d1e","html_url":"https://github.com/BugSplat-Git/bugsplat-js-api-client","commit_stats":{"total_commits":129,"total_committers":4,"mean_commits":32.25,"dds":0.2945736434108527,"last_synced_commit":"b6ad9a054c46f801b4c70f689ea5aa8194dc61df"},"previous_names":[],"tags_count":67,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BugSplat-Git%2Fbugsplat-js-api-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BugSplat-Git%2Fbugsplat-js-api-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BugSplat-Git%2Fbugsplat-js-api-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BugSplat-Git%2Fbugsplat-js-api-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BugSplat-Git","download_url":"https://codeload.github.com/BugSplat-Git/bugsplat-js-api-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241304300,"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":["api","apm","bugsplat","client","crash","error","javascript","reporting","typescript"],"created_at":"2025-03-01T01:38:51.916Z","updated_at":"2026-03-02T21:13:42.056Z","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[@bugsplat/js-api-client](https://www.npmjs.com/package/@bugsplat/js-api-client) is a set of JavaScript client libraries for consuming the BugSplat API. This package is compatible in both browser and node environments as it provides ESM and CommonJS builds for each environment respectively. Additionally this package is implemented in TypeScript and the distributed builds include definition files and source maps.\n\n## 🏗 Installation\n\nInstall [@bugsplat/js-api-client](https://www.npmjs.com/package/@bugsplat/js-api-client) via npm. This package currently requires Node.js 18 or later.\n\n```sh\nnpm i @bugsplat/js-api-client\n```\n\nIf you need to use a version of Node.js that's older than 18, you can install `@bugsplat/js-api-client@2.1.3`.\n\n## ⚙️ Configuration\n\nImport `BugSplatApiClient` and `Environment` from `@bugsplat\\js-api-client`\n\n```ts\nimport { BugSplatApiClient, Environment } from '@bugsplat/js-api-client';\n```\n\nCreate an authenticated `BugSplatApiClient` following the steps below. Authentication is slightly different depending on if you are use `@bugsplat/js-api-client` in a Node.js or Web Browser environment. The method used to authenticate also depends on if you already have access to the user's email and password, or if you have to prompt for it at a later time.\n\nThe `host` value used to create a new instance of `BugSplatApiClient` is `https://app.bugsplat.com` for most scenarios. When using this library to upload a crash reports the host value will be `https://{{database}}.bugsplat.com`.\n\n### Node.js\nThe static factory function `createAuthenticatedClientForNode` can be used to return an authenticated instance of `BugSplatApiClient` in Node.js environments.\n\n```ts\nconst bugsplat = await BugSplatApiClient.createAuthenticatedClientForNode(email, password, host);\n```\n\nIf you need to authenticate at a later time, you can create an instance of `BugSplatApiClient` and call `login` manually.\n\n```ts\nconst bugsplat = new BugSplatApiClient(host, Environment.Node);\nawait bugsplat.login(email, password);\n```\n\n### Web Browser\n\nThe static factory function `createAuthenticatedClientForWebBrowser` can be used to return an authenticated instance of `BugSplatApiClient`.\n\n```ts\nconst bugsplat = await BugSplatApiClient.createAuthenticatedClientForBrowser(email, password, host);\n```\n\nIf you need to authenticate at a later time, you can create an instance of `BugSplatApiClient` and call `login` manually.\n\n```ts\nconst bugsplat = new BugSplatApiClient(host, Environment.WebBrowser);\nawait bugsplat.login(email, password);\n```\n\n## ⌨️ Usage\n\nCreate an instance of `CrashApiClient` or any of the API clients and pass a reference to the `BugSplatApiClient` instance\n\n```ts\nconst client = new CrashApiClient(bugsplat);\n```\n\nThe API clients are built to automatically parse responses from BugSplat into objects that can be used by your application\n\n```ts\nconst database = 'Fred';\nconst id = 100389;\nconst crash = await client.getCrashById(database, id);\n\nfor (const stackFrame of crash.thread.stackFrames) {\n  console.log(stackFrame);\n}\n\n// StackFrame {\n//     fileName: 'C:\\\\BugSplat\\\\samples\\\\myConsoleCrasher\\\\myConsoleCrasher.cpp',\n//     functionName: 'myConsoleCrasher!MemoryException',\n//     lineNumber: 150,\n//     stackFrameLevel: 1,\n//     arguments: [],\n//     locals: []\n// }\n// StackFrame {\n//     fileName: 'C:\\\\BugSplat\\\\samples\\\\myConsoleCrasher\\\\myConsoleCrasher.cpp',\n//     functionName: 'myConsoleCrasher!wmain',\n//     lineNumber: 84,\n//     stackFrameLevel: 2,\n//     arguments: [\n//       { variable: 'int argc', value: '0n2' },\n//       { variable: 'wchar_t ** argv', value: '0x0125ef20' }\n//     ],\n//     locals: [\n//       { variable: 'int i', value: '0n1' },\n//       { variable: 'int argc', value: '0n2' },\n//       { variable: 'wchar_t ** argv', value: '0x0125ef20' }\n//     ]\n// }\n// ...\n```\n\n## 🧑‍💻 Contributing\n\nBugSplat ❤️s open source! If you feel that this package can be improved, please open an [Issue](https://github.com/BugSplat-Git/bugsplat-js-api-client/issues). If you have an awesome new feature you'd like to implement, we'd love to merge your [Pull Request](https://github.com/BugSplat-Git/bugsplat-js-api-client/pulls). You can also send us an [email](mailto:support@bugsplat.com), join us on [Discord](https://discord.gg/K4KjjRV5ve), or message us via the in-app chat on [bugsplat.com](https://bugsplat.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugsplat-git%2Fbugsplat-js-api-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbugsplat-git%2Fbugsplat-js-api-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugsplat-git%2Fbugsplat-js-api-client/lists"}