Specta LogoSpecta
1.0.0-rc.x (alpha)

Tauri

Mount the experimental Tauri IPC adapter and check protocol compatibility.

The rewrite includes a Tauri v2 adapter named tauri-plugin-rspc. It accepts built procedures and creates context from a Tauri window.

Rust setup

Use the same Git revision as the core crate in the quickstart:

[dependencies.tauri-plugin-rspc]
git = "https://github.com/specta-rs/rspc"
rev = "30402a42a6a523e0a76d23f3b7ce80903386a98d"

In your existing Tauri application:

let (procedures, types) = router().build().expect("invalid router");
rspc::Typescript::default()
    .export_to("../src/bindings.ts", &types)
    .expect("failed to export bindings");

tauri::Builder::default()
    .plugin(tauri_plugin_rspc::init(procedures, |_window| ()))
    .run(tauri::generate_context!())
    .expect("error while running application");

This assumes router() returns Router<()>. Return your own context from the window callback if the router needs application state.

Client compatibility

The Rust adapter in this revision uses Tauri channels. The repository's older @rspc/tauri TauriTransport uses events named plugin:rspc:transport and plugin:rspc:transport:resp. Those are different protocols. The old transport is not a drop-in client for this adapter.

When maintaining an existing app, keep the server plugin and frontend transport from the same protocol generation. Check a real request and a subscription before changing either dependency. TypeScript bindings alone cannot detect a transport mismatch.

The Tauri example and adapter source show the experimental implementation.

New applications

For typed Tauri commands and events without maintaining an rspc transport, use Tauri Specta. It integrates with Tauri's command and event APIs directly. It is not an automatic migration for an rspc router.

Edit on GitHub

Last updated on

On this page