Crates.io | sentry-tauri |
lib.rs | sentry-tauri |
version | 0.3.1 |
source | src |
created_at | 2022-06-21 11:25:00.020351 |
updated_at | 2024-10-19 16:09:15.219925 |
description | An experimental Tauri Plugin for Sentry |
homepage | |
repository | https://github.com/timfish/sentry-tauri/tree/tauri-v1 |
max_upload_size | |
id | 610168 |
size | 297,171 |
sentry-tauri
A Sentry plugin for Tauri v1.
For the Tauri v2 plugin see
tauri-plugin-sentry
It's perfectly reasonable to use Sentry's Rust and browser SDKs separately in a Tauri app. However, this plugin passes browser breadcrumbs and events through the Rust backend which has a number of advantages:
This example also shows usage of
sentry_rust_minidump
which
allows you to capture minidumps for native crashes from a separate crash
reporting process.
Add the required dependencies in Cargo.toml
:
[dependencies]
sentry-tauri = "0.3"
sentry
and sentry-rust-minidump
are re-exported by sentry-tauri
so you
don't need to add them as dependencies.
fn main() {
let client = sentry_tauri::sentry::init((
"__YOUR_DSN__",
sentry_tauri::sentry::ClientOptions {
release: sentry_tauri::sentry::release_name!(),
..Default::default()
},
));
// Everything before here runs in both app and crash reporter processes
let _guard = sentry_tauri::minidump::init(&client);
// Everything after here runs in only the app process
tauri::Builder::default()
.plugin(sentry_tauri::plugin())
.run(tauri::generate_context!())
.expect("error while running tauri app");
}
@sentry/browser
in every web-viewbeforeSend
and beforeBreadcrumb
hooks that intercept events and
breadcrumbs and passes them to the Rust SDK via the Tauri invoke
APIserde
+ existing Sentry Rust types = Deserialisation mostly Just
Works™️Clone this repository and install dependencies:
> yarn install
In examples/basic-app/src-tauri/src/main.rs
replace the DSN with your DSN
Run in development mode:
> yarn example