Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Tauri Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-tauri-knowledge-patch)
---
name: tauri-knowledge-patch
description: Tauri
version: "2.13.0"
license: MIT
metadata:
author: Nevaberry
---
# Tauri Knowledge Patch
Load this skill for Tauri migration, capabilities, configuration, IPC, plugins,
mobile integration, webviews, native windows, and distribution work. Use the
topic references for complete API details, platform limits, and examples.
## Reference index
| Reference | Topics |
| --- | --- |
| [Configuration, Capabilities, Permissions, and Security](references/configuration-security.md) | Configuration formats, command gates, capability matching, scopes, CSP, assets, response headers |
| [Core Plugins](references/core-plugins.md) | Dialogs, filesystem access, HTTP grants, stores, updater signing and feeds |
| [IPC, State, and Tray Icons](references/ipc-state-tray.md) | Commands, serialization, channels, managed state, events, menu actions, tray icons |
| [Migration](references/migration.md) | Configuration moves, allowlist conversion, Cargo features, environment variables, Rust APIs, sidecars |
| [Plugin and Mobile Development](references/plugin-mobile-development.md) | Plugin scaffolding, permissions, native commands, Android activities, mobile call contexts, build setup |
| [Project Setup and Distribution](references/project-distribution.md) | Toolchains, native dependencies, scaffolding, build hooks, resources, installers, signing |
| [Verso Runtime](references/verso-runtime.md) | Experimental runtime setup, supported integration features, limitations, scripts |
| [Windows, Webviews, and Application Runtime](references/windows-webviews-runtime.md) | Profiles, navigation, protocols, paths, window options, event loops, exit and restart |
## Breaking changes and deprecations
### Configuration and capability migration
Move `tauri.pattern` to `app.security.pattern` and `build.withGlobalTauri` to
`app.withGlobalTauri`. Replace `build.devPath` with the URL-only `build.devUrl`,
and `build.distDir` with `build.frontendDist`; its Rust type becomes `FrontendDist`.
Move updater configuration from `tauri.bundle.updater` to `plugins.updater`.
Remove the updater's `active` and `dialog` options; core `UpdaterEvent` was removed.
`cargo tauri migrate` converts the v1 allowlist into a capability file under
`src-tauri/capabilities`. Tauri checks permission before command dispatch and
attaches the configured scope. The receiving command must interpret and enforce
that scope itself.
### Rust interfaces and build requirements
Use `WebviewWindow` and `WebviewWindowBuilder` for the v1 window abstraction
that includes a webview. Multiple webviews in one native window require `unstable`.
Import types formerly in `tauri::command` from `tauri::ipc`, while retaining
`#[tauri::command]`. Import `WebviewAttributes` from `tauri-runtime` after removal
of Tauri's re-export.
Tauri 2.13 requires Rust 1.92 or newer. When exchanging native types with Tauri,
match its native crate versions; the distribution reference records the specific
dependencies and their release-specific requirements. Official plugin major
versions track Tauri's major, but individual plugins can break APIs in a minor.
### Managed state and event-loop cleanup
`Manager::unmanage` is deprecated because removing managed values can invalidate
outstanding references. Keep a container such as `Mutex<Option<T>>` registered
and update its contents under the lock when state must be cleared or replaced.
`InvokeMessage::state` and `InvokeMessage::state_ref` are deprecated; inject
`tauri::State<'_, T>` into a command instead.
Use `App::run_return` for an exit code and host cleanup after the loop finishes;
on iOS it falls back to `App::run`. `App::run_iteration` is deprecated because
calling it in a loop can busy-wait. Use `AppHandle::request_restart()` when
restart cleanup depends on reliable exit-event delivery. A manual call to
`cleanup_before_exit` must be followed by immediate exit.
### Browser origins and profile migration
The default custom-protocol scheme changed from `https` to `http` on Windows
and Android. Update affected origin checks and CSP entries. When migrating a
Windows app that used the v1 HTTPS origin, set `useHttpsScheme` to `true` to retain
IndexedDB, localStorage, and cookies; v1 `dangerousUseHttpScheme` data uses HTTP.
Use `profileIdentifier` or the builders' `profile_identifier` for browsing
profiles. Migrate from deprecated `dataStoreIdentifier`, `data_store_identifier`,
`fetchDataStoreIdentifiers`, and `removeDataStore` APIs, including their Rust
counterparts. The webview reference includes legacy platform and format limits.
### Menu and tray migrations
Replace `TrayIconBuilder::menu_on_left_click` with
`TrayIconBuilder::show_menu_on_left_click`. Use `iconIsTemplate` in place of
`iconAsTemplate`; both names set macOS template rendering when `true`.
Use `TrayIconBuilder::icon_templated` or `TrayIcon::set_icon_templated` to update
the image and template flag together. In 2.13, `linux-libxdo` is a no-op, so you
can remove it and the `libxdo-dev` build dependency.
## Command permissions and security
Commands registered with `Builder::invoke_handler` are callable by default from
the app's windows and webviews. To gate one, enroll it in the build manifest,
define its permission, and grant that permission in the intended capability.
The configuration reference contains the complete build and permission example.
A populated `app.security.capabilities` list selects the entire active set:
include every capability file identifier the build should use. Matching a
capability's `windows` grants it to every webview in that window. For access by
individual webview label, omit `windows` and match `webviews` instead.
Set `remote.urls` to opt matching remote pages into a capability. A deny applies
only when its capability matches the caller's local or remote execution context.
Scope-only plugin permissions contribute to the plugin's global scope; adding `commands.allow`
binds a scope to selected commands, with matching denies taking precedence.
`build.removeUnusedCommands` prunes commands using declared capabilities.
Include commands needed by dynamic capabilities in build-time capabilities too.
With `dynamic-acl`, scopes from `add_capability` remain separate from unrelated
build-time command scopes.
`app.security.headers` applies to non-error HTTP responses served to the webview;
IPC bypasses it. `app.security.csp` applies in development unless `devCsp` is set.
Tauri injects asset nonce and hash sources by default; `dangerousDisableAssetCspModification`
can disable injection for selected directives or, with `true`, all directives.
## IPC, events, and state
Use a `Result<T, E>` return type for an async command with borrowed arguments such
as `&str` or `State<'_, T>`. Requesting `State<T>` for an unregistered type produces
an invocation error.
For binary input, pass an `ArrayBuffer` or `Uint8Array` as `invoke`'s second
argument and inject `tauri::ipc::Request` to match `InvokeBody::Raw` in Rust.
For an object passed to `invoke`, its `[SERIALIZE_TO_IPC_FN]()` return value controls
its IPC serialization when the method is present.
`invoke` accepts a `Headers` instance in its third argument; non-ASCII characters
in `options.headers` cause the call to throw. Use `tauri::command_metadata!(greet)`
for the name, documentation, deprecation information, and argument names of a command
named `greet`. Enable `specta` to describe commands accepting `tauri::ipc::Request`
or returning `tauri::ipc::Response` in generated bindings.
`emit` broadcasts to all listeners; use `emit_to` or JavaScript's `emitTo` for a
specific target. Use `Emitter::emit_str` for already serialized JSON and
`Emitter::emit_filter` to select listeners by target kind and label.
Destroying a window or webview removes Rust `listen` and `once` handlers on that
target; destroying a webview also removes its JavaScript listeners from the backend.
Queued channel payloads and large invoke responses are readable only by their
owning webview and are purged when it closes. A JavaScript `Channel` continues
delivery when `onmessage` throws; the exception is rethrown asynchronously and
still surfaces as an uncaught error.
## Webviews, paths, and native windows
`profileIdentifier` selects a WebKit data store on macOS and iOS, or a WebView2
named profile on Windows. Windows profiles can share a data directory and browser
process while isolating cookies and storage. Use `fetchProfileIdentifiers` and
`removeProfile`, or their Rust equivalents, to list and delete profiles.
Use `WindowConfig::on_new_window` for declarative new-window handling. Its `urls`
scope matches globs by default and uses URLPattern with the `url-pattern` feature.
On macOS, iOS, and Linux, include the trailing slash in `tauri://localhost/` when
comparing against `location.href`.
Set `app.appDirectoriesOverride` for one-root or per-directory overrides of
`app_*_dir` paths; Tauri and plugins using those APIs share the override. Use
`Context::config_mut` to configure it at runtime. Resolve a listed sidecar with
`PathResolver::resolve_external_bin` or JavaScript's `resolveExternalBin`.
On Linux, HTML audio and video elements can play `asset://` URLs when
`app.security.assetProtocol.enable` is `true`.
The GStreamer plugin reads media directly, independently of
`app.security.assetProtocol.scope`. See the webview reference for its package
locations and the AppImage and development-build requirements.
Off the main thread, `WryHandle::display_handle` waits for the event loop. Both
threads can block if the main thread synchronously waits for a worker making
this call. On macOS, Liquid Glass uses `Regular` or `Clear`; on macOS 27.0 and newer,
enable the window effects `interactive` option for visual responses to interaction.
## Native plugins and mobile integration
Generate plugin permissions from the command list in the plugin's `build.rs`,
register the commands with its invoke handler, and grant namespaced permissions
in the app capability. Typed `CommandScope` and `GlobalScope` expose `.allows()`
and `.denies()`; the plugin reference includes scope schema generation.
Use `PluginHandle::run_mobile_plugin_with_webview` or
`run_mobile_plugin_with_webview_async` to supply the calling webview's host.
Presentation helpers return `nil` or `null` when the contextual host is gone.
A contextual call fails with `ORIGIN_UNAVAILABLE` if the webview disappears
before native dispatch. Late mobile plugin responses are discarded when the
caller has stopped waiting, including after an async timeout.
Handle `RunEvent::ActivityRequested` and pass its `activity_id` to the window
builder to attach a window to an Android activity. Android handles Back itself
when neither webview back history nor a `back-button` listener is present.
Run `tauri ios dev --host` when an iOS app cannot reach the server at `localhost`.
Declare Swift `@_cdecl` functions called from Rust as `public` for Xcode 27 release builds.
## Plugin data and release packaging
`http:default` grants fetch commands with an empty URL allowlist; add URL grants.
`fs:default` permits recursive reads in AppConfig, AppData, AppLocalData, AppCache,
and AppLog and creation of those base directories with `mkdir`. Grant
`fs:allow-appdata-write-recursive` for those writes and account for the default
deny protecting `$APPLOCALDATA/EBWebView`.
Stores loaded for a path are shared between Rust and JavaScript; later loads
ignore new options. `autoSave` defaults to a 100 ms debounce. With `autoSave` set to `false`,
graceful exit still saves changes, and `await store.save()` writes immediately.
Updater signature verification is mandatory. Put public key contents in
`plugins.updater.pubkey`; supply `TAURI_SIGNING_PRIVATE_KEY` in the build process
environment outside `.env`. A static feed validates every listed platform before
comparing versions. A dynamic feed returns `204 No Content` or `200 OK` with
top-level `version`, `url`, and `signature`. A 2xx response stops endpoint fallback.
Use `build --no-bundle` to compile once, then `bundle` for each release channel's
formats and configuration. Pin `bundle.windows.wix.upgradeCode` to the existing
MSI GUID before renaming a product; the default GUID derives from `productName`.
See the distribution reference for NSIS downgrade enforcement and custom language strings.
## Tray interaction and experimental runtime
Enable `linux-ksni` for Linux StatusNotifierItem left and middle tray clicks and tooltips.
`showMenuOnRightClick` defaults to `true`; disable it in tray configuration or
through the builder or runtime setter. `TrayIcon::show_menu` or `await tray.showMenu()`
opens the menu at the cursor. Use `autosaveName` for stable macOS tray positions.
The experimental `tauri-runtime-verso` replaces `tauri-runtime-wry`. In the
March 2025 integration, build Verso for `versoview`, set its executable path and
optional resource directory before creating webview windows, and register
`INVOKE_SYSTEM_SCRIPTS`. The Verso reference records supported features, planned
window options, and document-start scripts loaded from disk.