Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
tauri-plugin-sentry
A Sentry plugin for Tauri v2.
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:
- Browser events are enriched with Rust, OS and device context
- Events from both Rust and browser will have the same app and device context
- Breadcrumbs are merged from both the Rust and browser SDKs
- See what was happening in the Rust backend and the browser frontend at the time of the event
Installation
sentry
and sentry-rust-minidump
are re-exported by sentry-tauri
so you
don't need to add them as dependencies.
Add tauri-plugin-sentry
to dependencies in Cargo.toml
:
[]
= "0.4"
Run one of these commands to add the capabilities:
- npm:
npm run tauri add sentry
- yarn:
yarn run tauri add sentry
- pnpm:
pnpm tauri add sentry
- cargo:
cargo tauri add sentry
however, make sure that you have sentry:default
in your capabilities:
src-tauri/capabilities/*.json
Usage
This example also shows usage of
sentry_rust_minidump
which
allows you to capture minidumps for native crashes from a separate crash
reporting process.
use ;
The Plugin:
- By default injects and initialises
@sentry/browser
in every web-view - Includes custom
transport
andbeforeBreadcrumb
hook that passes events and breadcrumbs to the Rust SDK via the Tauriinvoke
API - Tauri +
serde
+ existing Sentry Rust types = Deserialisation mostly Just Works™️
Custom Sentry Browser Configuration
By default the plugin injects a pre-minified version of @sentry/browser
. If
you want to configure Sentry in the browser yourself, you can disable the
injection and pass the default config to Sentry.init
.
Disable automatic injection:
.plugin
.run
.expect;
default
import { defaultOptions } from "tauri-plugin-sentry-api";
import * as Sentry from "@sentry/browser";
Sentry.init({
...defaultOptions,
/**
* Your custom configuration here
*/
});
Example App
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