Tauri 2.0

website·Indexed 39 days ago

https://tauri.app

A cross-platform app building toolkit for creating small, fast, and secure applications. Tauri is frontend agnostic, supporting frameworks like Next.js 14.2.3, Nuxt 4.2, SvelteKit 2.20.4, and Leptos, while using a Rust-based backend. The documentation covers core concepts, inter-process communication (IPC), multi-process architecture, and migration guides from Tauri 1.0 to 2.0.

Tokens
196.3K
Snippets
1.3K
Records
1.6K
Agent score
75%

What's inside Tauri

  1. Overview of the Tauri toolkit

    Tauri is a toolkit for building desktop applications for major platforms. It uses a polyglot architecture: the core is built with Rust, and the CLI leverages Node.js. This allows developers to use virtually any existing frontend framework for the UI while maintaining a high-performance backend.
  2. Overview of Tauri 2.0 features and mobile support

    Tauri 2.0 is the 'Mobile Update', expanding the framework's capabilities beyond desktop. Key features include:

    • iOS and Android Support: Ability to build and run Tauri apps on mobile platforms.
    • Modular Plugin System: Many core Tauri APIs have moved to a plugin system to improve maintainability and allow developers to build custom plugins.
    • Swift and Kotlin Bindings: Plugin developers can now write platform-specific code in Swift (iOS) and Kotlin (Android) to integrate more closely with mobile systems, complementing the existing Rust-to-JavaScript bridge.
  3. Overview of Official Tauri Plugins

    Tauri provides a set of official plugins to extend application functionality across desktop and mobile platforms. Key official features include:

    • System Integration: Autostart, Clipboard, Command Line Interface (CLI), Deep Linking, Global Shortcut, Notifications, Opener, and Single Instance.
    • Hardware & Sensors: Barcode Scanner (mobile), Biometric authentication (Android/iOS), Geolocation, Haptics (Android/iOS), and NFC (Android/iOS).
    • File & Data Management: File System access, Dialogs (open/save/message), Persisted Scope, SQL database interface (via sqlx), Store (key-value), and Stronghold (encrypted database).
    • Network & Communication: HTTP Client (Rust-based), Localhost server, Upload (HTTP), and Websocket.
    • OS & Window Management: OS Information, Positioner (window placement), Process access, Shell (child processes), and Window State persistence.
    • App Maintenance: Logging and Updater (in-app updates).
  4. Overview of Tauri Architecture

    Tauri is a toolkit for building desktop applications using Rust and HTML rendered in a Webview. It allows developers to bridge a web-based frontend with a Rust-based backend via message passing. Key architectural characteristics include:

    • Small Binaries: Uses the operating system's native webview rather than shipping a bundled runtime.
    • Security: Compiled from Rust, making reverse engineering more difficult than interpreted runtimes.
    • System Integration: Supports system tray interfaces and OS-managed updates.
    • Core Dependencies: Relies on WRY for webview interfacing and TAO for window management.
  5. Overview of the Tauri Isolation Pattern

    The Isolation pattern is a security mechanism that intercepts and modifies Tauri API messages sent from the frontend before they reach Tauri Core. It achieves this by injecting a secure JavaScript 'Isolation application' inside a sandboxed <iframe>.

    This pattern is primarily designed to mitigate 'Development Threats'—risks arising from untrusted or deeply-nested dependencies in the frontend build process. It is highly recommended for any application using external Tauri APIs, as it allows developers to verify IPC inputs (e.g., ensuring file system access is restricted to expected paths or validating HTTP fetch Origin headers) before they are processed by the Rust core.

  6. Overview of the Tauri Framework

    Tauri is a framework used to build small, fast binaries for major desktop and mobile platforms. It allows developers to use any frontend framework that compiles to HTML, JavaScript, and CSS for the user interface, while utilizing Rust, Swift, or Kotlin for backend logic. Key architectural components include TAO (window creation) and WRY (webview rendering).
  7. Overview of Multi-Window support on Mobile

    Tauri supports multiple windows on Android and iOS. On Android, this is implemented via Activity Embedding (side-by-side activities on large screens). On iOS, it uses the UIScene API (multiple instances on iPad).

    Platform Constraints:

    • Android: Requires Android 12L (API 32)+. On handsets, new windows are typically pushed onto the activity back stack.
    • iOS: Requires iOS 13+. True concurrent windows are primarily an iPad/Stage Manager experience; on iPhone, new windows often replace the current UI.
    • Runtime Check: Use the app.supportsMultipleWindows API to check availability at runtime.
  8. Overview of the Tauri app construction toolkit

    Tauri is a toolkit for building desktop software for all major operating systems using web technologies. It utilizes Rust for core libraries and allows the user interface to be written in virtually any frontend framework. Key features include an optional tree-shakeable JavaScript API for system access, a desktop binary bundler with code signing and artifact verification, a secure updater, an extensive plugin system, and OS-level integrations like notifications and app trays.
  9. Overview of Tauri Inter-Process Communication (IPC)

    Tauri utilizes Asynchronous Message Passing for Inter-Process Communication (IPC), allowing isolated processes to exchange serialized requests and responses. This approach is more secure than shared memory or direct function access because the recipient (e.g., the Tauri Core process) can validate and reject malicious requests before execution.
  10. Understand the Tauri Governance structure

    Tauri uses a collective framework called the Tauri Working Group to ensure open-source values and sustainable development. The structure consists of:

    • Tauri Board & Board Directors: The central decision-making body responsible for the overall health, stability, and voting on major decisions of the Tauri Programme.
    • Domains & Domain Leads: Organizational units representing specific areas of interest. Domain Leads are trusted experts who set direction and oversee activities within their domain.
    • Teams: Small groups of contributors focused on maintaining specific areas or executing long-term goals that require more than ad-hoc contributions.
    • Working Group Members: All individuals comprising the Tauri Working Group.
  11. Understand Tauri's Trust Boundary security model

    Tauri employs a security model based on trust boundaries to separate high-privilege Rust code from lower-privilege frontend code.

    • Rust Core: Code executed by plugins or the application core has full access to all available system resources.
    • WebView Frontend: Code executed in the WebView can only access system resources exposed via the Inter-Process Communication (IPC) layer. Access is restricted by capabilities and permissions defined in the application configuration.
    • IPC Layer: Acts as the bridge between these two trust groups, ensuring that boundaries are not broken and preventing privilege escalation.