{"id":21882392,"url":"https://github.com/essent/nativescript-ng-sentry","last_synced_at":"2025-04-15T05:55:10.500Z","repository":{"id":27349031,"uuid":"113557401","full_name":"Essent/nativescript-ng-sentry","owner":"Essent","description":"Nativescript plugin for Sentry to log NativeScript crashes.","archived":false,"fork":false,"pushed_at":"2022-03-07T13:45:49.000Z","size":2113,"stargazers_count":1,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T05:55:05.507Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Essent.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":"2017-12-08T09:33:34.000Z","updated_at":"2022-03-07T13:45:53.000Z","dependencies_parsed_at":"2022-07-27T09:32:03.389Z","dependency_job_id":null,"html_url":"https://github.com/Essent/nativescript-ng-sentry","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Essent%2Fnativescript-ng-sentry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Essent%2Fnativescript-ng-sentry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Essent%2Fnativescript-ng-sentry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Essent%2Fnativescript-ng-sentry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Essent","download_url":"https://codeload.github.com/Essent/nativescript-ng-sentry/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249016320,"owners_count":21198832,"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":[],"created_at":"2024-11-28T09:28:50.059Z","updated_at":"2025-04-15T05:55:10.483Z","avatar_url":"https://github.com/Essent.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NativeScript plugin for Sentry\n\n[![npm version](https://badge.fury.io/js/%40essent%2Fnativescript-ng-sentry.svg)](https://www.npmjs.com/package/@essent/nativescript-ng-sentry)\n\nThis is a plugin to log app crashes with [Sentry](https://sentry.io).\n\n## Installation\n\nRun the following command from the root of your project:\n\n```\n$ tns plugin add @essent/nativescript-ng-sentry\n```\n\nThis command automatically installs the necessary files, as well as stores nativescript-ng-sentry as a dependency in your project's `package.json` file.\n\n## Usage \n\nTo use nativescript-ng-sentry you must first `import` the module:\n\n```ts\nimport { NgSentry } from '@essent/nativescript-ng-sentry';\n```\n\nAt the launch of your app call `setCredentials` with your own credentials, these can be found in your Sentry Project Settings, Client Keys (DSN). Use the public DSN for these credentials. Optionally you can also provide an environment and a user id.\n\n```ts\nNgSentry.getInstance().setCredentials('123456', '123456789abcdefghijklmnopqrstuvw', 'development', 'unique-user-id');\n```\n\nTo log a crash, call `saveCrash` with a message and details.\nThe details will be used as a Sentry breadcrumb, you can use this to save a stacktrace, for example.\nYou can have a look at [our example](./demo/app/app.ts) on how to call this with an uncaughtErrorEvent.\n\n```ts\nNgSentry.getInstance().saveCrash('My crash message', 'My crash details');\n```\n\nCrashes are not send to Sentry automatically, you can call `sendCrashes` to send all saved crashes to Sentry.\nWe suggest you call this method in the resume event of your app.\n\n```ts\nNgSentry.getInstance().sendCrashes();\n```\n\n### Breadcrumbs (optional)\n\nYou can save breadcrumbs to see what a user did before a crash occurred, these will be added to the next crash you save.\nTo add a breadcrumb use `saveBreadcrumb` with a title and category.\n\n```ts\nNgSentry.getInstance().saveBreadcrumb('Routed to details page', 'state');\n```\n\nOptionally you can add extra data to the breadcrumb.\n\n```ts\nconst properties: KeyValue\u003cstring\u003e = {\n    page: 'Change user data',\n    changed: 'Username'\n};\nNgSentry.getInstance().saveBreadcrumb('Save success', 'action', properties);\n```\n\nOptionally you can set a maximum amount of breadcrumbs, the default is 50.\n```ts\nNgSentry.getInstance().setMaxAmountOfBreadcrumbs(10);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fessent%2Fnativescript-ng-sentry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fessent%2Fnativescript-ng-sentry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fessent%2Fnativescript-ng-sentry/lists"}