{"id":18307813,"url":"https://github.com/exceptionless/exceptionless.javascript","last_synced_at":"2025-04-10T03:53:53.198Z","repository":{"id":26114489,"uuid":"29558878","full_name":"exceptionless/Exceptionless.JavaScript","owner":"exceptionless","description":"Exceptionless JavaScript client","archived":false,"fork":false,"pushed_at":"2024-03-29T12:46:42.000Z","size":12256,"stargazers_count":60,"open_issues_count":0,"forks_count":23,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-10T03:53:40.614Z","etag":null,"topics":["angular","bug-tracking-tool","crash-reporting","crash-reporting-tool","error-reporting","error-stack-trace","exception-handler","exceptionfilter","exceptionless","exceptions","express","javascript","logging","logging-library","node","nodejs","react","svelte","unhandled-exceptions","vue"],"latest_commit_sha":null,"homepage":"http://exceptionless.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/exceptionless.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"exceptionless"}},"created_at":"2015-01-20T22:38:28.000Z","updated_at":"2025-01-20T13:34:48.000Z","dependencies_parsed_at":"2023-01-14T04:03:33.663Z","dependency_job_id":"67896c3e-f142-4cb6-b25d-0129395459ed","html_url":"https://github.com/exceptionless/Exceptionless.JavaScript","commit_stats":{"total_commits":657,"total_committers":13,"mean_commits":50.53846153846154,"dds":"0.22678843226788437","last_synced_commit":"91fa4884f831064fccb5f4d903adcb7e05daee16"},"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exceptionless%2FExceptionless.JavaScript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exceptionless%2FExceptionless.JavaScript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exceptionless%2FExceptionless.JavaScript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exceptionless%2FExceptionless.JavaScript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/exceptionless","download_url":"https://codeload.github.com/exceptionless/Exceptionless.JavaScript/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248155000,"owners_count":21056542,"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":["angular","bug-tracking-tool","crash-reporting","crash-reporting-tool","error-reporting","error-stack-trace","exception-handler","exceptionfilter","exceptionless","exceptions","express","javascript","logging","logging-library","node","nodejs","react","svelte","unhandled-exceptions","vue"],"created_at":"2024-11-05T16:05:32.574Z","updated_at":"2025-04-10T03:53:53.170Z","avatar_url":"https://github.com/exceptionless.png","language":"TypeScript","readme":"# Exceptionless.JavaScript\n\n[![Build status](https://github.com/Exceptionless/Exceptionless.JavaScript/workflows/Build/badge.svg)](https://github.com/Exceptionless/Exceptionless.JavaScript/actions)\n[![Discord](https://img.shields.io/discord/715744504891703319)](https://discord.gg/6HxgFCx)\n[![NPM version](https://img.shields.io/npm/v/@exceptionless/core.svg)](https://www.npmjs.org/package/@exceptionless/core)\n\nThe definition of the word exceptionless is: to be without exception. Exceptionless provides real-time error reporting for your JavaScript applications in the browser or in Node.js. It organizes the gathered information into simple actionable data that will help your app become exceptionless!\n\n## Browser\n\nYou can install the npm package via `npm install @exceptionless/browser --save`\nor via cdn [`https://unpkg.com/@exceptionless/browser`](https://unpkg.com/@exceptionless/browser).\nNext, you just need to call startup during your apps startup to automatically\ncapture unhandled errors.\n\n```js\nimport { Exceptionless } from \"https://unpkg.com/@exceptionless/browser\";\n\nawait Exceptionless.startup((c) =\u003e {\n  c.apiKey = \"API_KEY_HERE\";\n  c.setUserIdentity(\"12345678\", \"Blake\");\n\n  // set some default data\n  c.defaultData[\"mydata\"] = {\n    myGreeting: \"Hello World\"\n  };\n\n  c.defaultTags.push(\"Example\", \"JavaScript\", \"Browser\");\n});\n\ntry {\n  throw new Error(\"test\");\n} catch (error) {\n  await Exceptionless.submitException(error);\n}\n```\n\n## Node\n\nYou can install the npm package via `npm install @exceptionless/node --save`.\nNext, you just need to call startup during your apps startup to automatically\ncapture unhandled errors.\n\n```js\nimport { Exceptionless } from \"@exceptionless/node\";\n\nawait Exceptionless.startup((c) =\u003e {\n  c.apiKey = \"API_KEY_HERE\";\n  c.setUserIdentity(\"12345678\", \"Blake\");\n\n  // set some default data\n  c.defaultData[\"mydata\"] = {\n    myGreeting: \"Hello World\"\n  };\n\n  c.defaultTags.push(\"Example\", \"JavaScript\", \"Node\");\n});\n\ntry {\n  throw new Error(\"test\");\n} catch (error) {\n  await Exceptionless.submitException(error);\n}\n```\n\n## Using Exceptionless\n\n### Installation\n\nYou can install Exceptionless either in your browser application using a `script`\ntag, or you can use the Node Package Manager (npm) to install the package.\n\n#### Browser application\n\nUse one of the following methods to install Exceptionless into your browser application:\n\n##### CDN\n\nAdd the following script tag at the very beginning of your page:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import { Exceptionless } from \"https://unpkg.com/@exceptionless/browser\";\n\n  await Exceptionless.startup((c) =\u003e {\n    c.apiKey = \"API_KEY_HERE\";\n  });\n\u003c/script\u003e\n```\n\n##### npm\n\n1. Install the package by running `npm install @exceptionless/browser --save`.\n2. Import Exceptionless and call startup during app startup.\n\n```js\nimport { Exceptionless } from \"@exceptionless/browser\";\n\nawait Exceptionless.startup((c) =\u003e {\n  c.apiKey = \"API_KEY_HERE\";\n});\n```\n\n#### Node.js\n\nUse this method to install Exceptionless into your Node application:\n\n1. Install the package by running `npm install @exceptionless/node --save`.\n2. Import the Exceptionless module in your application:\n\n```js\nimport { Exceptionless } from \"@exceptionless/node\";\n\nawait Exceptionless.startup((c) =\u003e {\n  c.apiKey = \"API_KEY_HERE\";\n});\n```\n\n### Configuring the client\n\nIn order to use Exceptionless, the `apiKey` setting has to be configured first.\nYou can configure the `ExceptionlessClient` class by calling\n`await Exceptionless.startup(\"API_KEY_HERE\");`. If you want to configure\nadditional client settings you'll want to call the `startup` overload that takes\na callback as shown below:\n\n```js\nawait Exceptionless.startup((c) =\u003e {\n  c.apiKey = \"API_KEY_HERE\";\n});\n```\n\nPlease see the [docs](https://exceptionless.com/docs/clients/javascript/) for\nmore information on configuring the client.\n\n### Submitting Events and Errors\n\nOnce configured, Exceptionless will automatically submit any unhandled exceptions\nthat happen in your application to the Exceptionless server. The following\nsections will show you how to manually submit different event types as well as\ncustomize the data that is sent:\n\n#### Submitting Events\n\nYou may also want to submit log messages, feature usage data or other kinds of events. You can do this very easily with the fluent API:\n\n```js\nimport { Exceptionless } from \"@exceptionless/browser\";\n\nawait Exceptionless.submitLog(\"Logging made easy\");\n\n// You can also specify the log source and log level.\n// We recommend specifying one of the following log levels: Trace, Debug, Info, Warn, Error\nawait Exceptionless.submitLog(\"app.logger\", \"This is so easy\", \"Info\");\nawait Exceptionless.createLog(\"app.logger\", \"This is so easy\", \"Info\").addTags(\"Exceptionless\").submit();\n\n// Submit feature usages\nawait Exceptionless.submitFeatureUsage(\"MyFeature\");\nawait Exceptionless.createFeatureUsage(\"MyFeature\").addTags(\"Exceptionless\").submit();\n\n// Submit a 404\nawait Exceptionless.submitNotFound(\"/somepage\");\nawait Exceptionless.createNotFound(\"/somepage\").addTags(\"Exceptionless\").submit();\n\n// Submit a custom event type\nawait Exceptionless.submitEvent({ message = \"Low Fuel\", type = \"racecar\", source = \"Fuel System\" });\n```\n\n#### Manually submitting Errors\n\nIn addition to automatically sending all unhandled exceptions, you may want to\nmanually send exceptions to the service. You can do so by using code like this:\n\n```js\nimport { Exceptionless } from \"@exceptionless/node\";\n\nawait Exceptionless.startup(\"API_KEY_HERE\");\n\ntry {\n  throw new Error(\"test\");\n} catch (error) {\n  await Exceptionless.submitException(error);\n}\n```\n\n#### Sending Additional Information\n\nYou can easily include additional information in your error reports using the fluent [event builder API](https://github.com/exceptionless/Exceptionless.JavaScript/blob/master/packages/core/src/EventBuilder.ts).\n\n```js\nimport { Exceptionless } from \"@exceptionless/node\";\nawait Exceptionless.startup(\"API_KEY_HERE\");\n\ntry {\n  throw new Error(\"Unable to create order from quote.\");\n} catch (error) {\n  await Exceptionless.createException(error)\n    // Set the reference id of the event so we can search for it later (reference:id).\n    .setReferenceId(\"random guid\")\n    // Add the order object (the ability to exclude specific fields will be coming in a future version).\n    .setProperty(\"Order\", order)\n    // Set the quote number.\n    .setProperty(\"Quote\", 123)\n    // Add an order tag.\n    .addTags(\"Order\")\n    // Mark critical.\n    .markAsCritical()\n    // Set the coordinates of the end user.\n    .setGeo(43.595089, -88.444602)\n    // Set the user id that is in our system and provide a friendly name.\n    .setUserIdentity(user.Id, user.FullName)\n    // Submit the event.\n    .submit();\n}\n```\n\n## Self hosted options\n\nThe Exceptionless client can also be configured to send data to your self hosted\ninstance. This is configured by setting the `serverUrl` on the default\n`ExceptionlessClient` when calling `startup`:\n\n```js\nawait Exceptionless.startup((c) =\u003e {\n  c.apiKey = \"API_KEY_HERE\";\n  c.serverUrl = \"https://localhost:5100\";\n});\n```\n\n### General Data Protection Regulation\n\nBy default the Exceptionless Client will report all available metadata including potential PII data.\nYou can fine tune the collection of information via Data Exclusions or turning off collection completely.\n\nPlease visit the [docs](https://exceptionless.com/docs/clients/javascript/client-configuration/#general-data-protection-regulation)\nfor detailed information on how to configure the client to meet your requirements.\n\n## Support\n\nIf you need help, please contact us via in-app support,\n[open an issue](https://github.com/exceptionless/Exceptionless.JavaScript/issues/new)\nor [join our chat on Discord](https://discord.gg/6HxgFCx). We’re always here to\nhelp if you have any questions!\n\n## Contributing\n\nIf you find a bug or want to contribute a feature, feel free to create a pull request.\n\n1. Clone this repository:\n\n   ```sh\n   git clone https://github.com/exceptionless/Exceptionless.JavaScript.git\n   ```\n\n2. Install [Node.js](https://nodejs.org). Node is used for building and testing purposes.\n3. Install the development dependencies using [npm](https://www.npmjs.com).\n\n   ```sh\n   npm install\n   ```\n\n4. Build the project by running the following command.\n\n   ```sh\n   npm run build\n   ```\n\n5. Test the project by running the following command.\n\n   ```sh\n   npm test\n   ```\n\n## Thanks\n\nThanks to all the people who have contributed!\n\n[![contributors](https://contributors-img.web.app/image?repo=exceptionless/Exceptionless.JavaScript)](https://github.com/exceptionless/Exceptionless.JavaScript/graphs/contributors)\n","funding_links":["https://github.com/sponsors/exceptionless"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexceptionless%2Fexceptionless.javascript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexceptionless%2Fexceptionless.javascript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexceptionless%2Fexceptionless.javascript/lists"}