{"id":13800748,"url":"https://github.com/timfish/sentry-tauri","last_synced_at":"2025-04-12T18:46:00.722Z","repository":{"id":44376862,"uuid":"461339819","full_name":"timfish/sentry-tauri","owner":"timfish","description":"A Tauri plugin for Sentry","archived":false,"fork":false,"pushed_at":"2025-01-20T19:44:34.000Z","size":1419,"stargazers_count":84,"open_issues_count":5,"forks_count":18,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-04T02:42:58.051Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timfish.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2022-02-19T23:39:16.000Z","updated_at":"2025-03-26T10:33:47.000Z","dependencies_parsed_at":"2025-02-15T13:10:51.755Z","dependency_job_id":"5f7657ee-9daa-44d8-bb73-eb465a8f3f48","html_url":"https://github.com/timfish/sentry-tauri","commit_stats":{"total_commits":12,"total_committers":2,"mean_commits":6.0,"dds":0.08333333333333337,"last_synced_commit":"0f4677f41ed7221e485565dda69c7ec01d5220e1"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timfish%2Fsentry-tauri","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timfish%2Fsentry-tauri/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timfish%2Fsentry-tauri/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timfish%2Fsentry-tauri/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timfish","download_url":"https://codeload.github.com/timfish/sentry-tauri/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248617492,"owners_count":21134191,"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-08-04T00:01:15.832Z","updated_at":"2025-04-12T18:46:00.698Z","avatar_url":"https://github.com/timfish.png","language":"Rust","funding_links":[],"categories":["Development"],"sub_categories":["Plugins"],"readme":"# `tauri-plugin-sentry`\n\nA Sentry plugin for Tauri v2.\n\nIt's perfectly reasonable to use Sentry's Rust and browser SDKs separately in a\nTauri app. However, this plugin passes browser breadcrumbs and events through\nthe Rust backend which has a number of advantages:\n\n- Browser events are enriched with Rust, OS and device context\n  - Events from both Rust and browser will have the same app and device context\n- Breadcrumbs are merged from both the Rust and browser SDKs\n  - See what was happening in the Rust backend and the browser frontend at the\n    time of the event\n\n## Installation\n\n`sentry` and `sentry-rust-minidump` are re-exported by `sentry-tauri` so you\ndon't need to add them as dependencies.\n\nAdd `tauri-plugin-sentry` to dependencies in `Cargo.toml`:\n\n```toml\n[dependencies]\ntauri-plugin-sentry = \"0.4\"\n```\n\nRun one of these commands to add the capabilities:\n\n- npm: `npm run tauri add sentry`\n- yarn: `yarn run tauri add sentry`\n- pnpm: `pnpm tauri add sentry`\n- cargo: `cargo tauri add sentry`\n\nhowever, make sure that you have `sentry:default` in your capabilities:\n\n###### src-tauri/capabilities/*.json\n\n```json\n{\n  \"$schema\": \"./../gen/schemas/windows-schema.json\",\n  \"identifier\": \"main\",\n  \"local\": true,\n  \"windows\": [\n    \"main\"\n  ],\n  \"permissions\": [\n    \"sentry:default\" // \u003c- important\n  ]\n}\n```\n\n## Usage\n\nThis example also shows usage of\n[`sentry_rust_minidump`](https://github.com/timfish/sentry-rust-minidump) which\nallows you to capture minidumps for native crashes from a separate crash\nreporting process.\n\n```rust\nuse tauri_plugin_sentry::{minidump, sentry};\n\npub fn run() {\n    let client = sentry::init((\n        \"__YOUR_DSN__\",\n        sentry::ClientOptions {\n            release: sentry::release_name!(),\n            auto_session_tracking: true,\n            ..Default::default()\n        },\n    ));\n\n    // Caution! Everything before here runs in both app and crash reporter processes\n    #[cfg(not(target_os = \"ios\"))]\n    let _guard = minidump::init(\u0026client);\n    // Everything after here runs in only the app process\n\n    tauri::Builder::default()\n        .plugin(tauri_plugin_sentry::init(\u0026client))\n        .run(tauri::generate_context!())\n        .expect(\"error while running tauri app\");\n}\n```\n\nThe Plugin:\n\n- By default injects and initialises `@sentry/browser` in every web-view\n- Includes custom `transport` and `beforeBreadcrumb` hook that passes events and\n  breadcrumbs to the Rust SDK via the Tauri `invoke` API\n- Tauri + `serde` + existing Sentry Rust types = Deserialisation mostly Just\n  Works™️\n\n## Custom Sentry Browser Configuration\n\nBy default the plugin injects a pre-minified version of `@sentry/browser`. If\nyou want to configure Sentry in the browser yourself, you can disable the\ninjection and pass the default config to `Sentry.init`.\n\nDisable automatic injection:\n\n```rust\ntauri::Builder::default()\n    .plugin(tauri_plugin_sentry::init_with_no_injection(\u0026client))\n    .run(tauri::generate_context!())\n    .expect(\"error while running tauri app\");\n```\n\n```ts\nimport { defaultOptions } from \"tauri-plugin-sentry-api\";\nimport * as Sentry from \"@sentry/browser\";\n\nSentry.init({\n  ...defaultOptions,\n  /**\n   * Your custom configuration here\n   */\n});\n```\n\n## Example App\n\nClone this repository and install dependencies:\n\n```shell\n\u003e yarn install\n```\n\nIn `examples/basic-app/src-tauri/src/main.rs` replace the DSN with your DSN\n\nRun in development mode:\n\n```shell\n\u003e yarn example\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimfish%2Fsentry-tauri","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimfish%2Fsentry-tauri","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimfish%2Fsentry-tauri/lists"}