tauri-bridge

Guide renderer-to-Rust integration for Tauri 2 apps using Specta typed bindings.

2|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/jonaseck2/slaktforskning --skill tauri-bridge
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tauri-bridge
Source: https://github.com/jonaseck2/slaktforskning/tree/main/.claude/skills/tauri-bridge
Command: npx skills add https://github.com/jonaseck2/slaktforskning --skill tauri-bridge

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents Tauri renderer ↔ Rust integration mistakes by guiding how to correctly add, type, and wire new API bindings so features work reliably across file I/O, dialogs, media, multi-window orchestration, and SQLite access.

Core Features & Use Cases

  • Renderer-side vs Rust-backed decisioning: decide when a task can be done purely in TypeScript bindings versus when a native Rust command is required.
  • Specta command lifecycle: cover annotating Rust Tauri commands with #[tauri::command] and #[specta::specta], deriving specta::Type for all involved types, and registering commands so bindings.ts is regenerated.
  • Renderer polyfills and invoke/error conventions: implement renderer api.* polyfills that call typed commands.*, handle Specta Result<T, String> envelopes safely, and follow the success/error object convention.

Quick Start

Update src/renderer/tauri-window-api.ts when the change can be expressed as pure TypeScript over the renderer DB shim, otherwise add a Rust #[tauri::command] with #[specta::specta] in src-tauri/ and regenerate src/renderer/bindings.ts before wiring a matching renderer polyfill.

Frequently Asked Questions about tauri-bridge

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new Rust command in Tauri 2 and wire it to the renderer?

To add a Rust command in Tauri 2, annotate your function with #[tauri::command] and #[specta::specta], register it in collect_commands!, then regenerate bindings.ts to wire the renderer polyfill.

When should I use a TypeScript polyfill versus a native Rust command in Tauri?

Use a TypeScript polyfill in tauri-window-api.ts when a task operates purely over the renderer database shim, and use a native Rust command when requiring filesystem, dialogs, media, or multi-window orchestration.

How does Specta typed bindings work with Tauri IPC?

Specta typed bindings act as the source of truth for Tauri IPC by deriving specta::Type for involved Rust structs, generating a bindings.ts file, and enforcing renderer invoke and error-handling conventions safely.

How do I handle Specta Result envelopes in a Tauri renderer?

Handle Specta Result envelopes in a Tauri renderer by implementing api polyfills that call typed commands, safely unwrapping the Result<T, String> object, and following the established success or error object convention.

What is the JsonValueWire workaround for Specta types in Tauri?

The JsonValueWire workaround is a provided type derivation method used when deriving specta types for Tauri commands, ensuring complex JSON values are correctly typed across the Rust to renderer bridge.

Does this Tauri bridge approach support multi-window orchestration and SQLite access?

Yes, this Tauri bridge approach supports multi-window orchestration and SQLite access by selecting the correct bridge mechanism for each feature and defining typed renderer polyfills for secondary databases.