Skip to main content
tauri-plugin-configurate is a standard Tauri v2 plugin written in Rust. You add it as a dependency to your Tauri app’s src-tauri/Cargo.toml, register it once in your main.rs or lib.rs with Builder::default().plugin(...), and the plugin registers all IPC command handlers automatically. No additional Rust code is required for typical usage — the TypeScript SDK handles everything through Tauri’s IPC layer.

Requirements

The plugin requires Rust 1.77.2 or newer. This is the rust-version declared in the plugin’s own Cargo.toml.

Adding the dependency

Add the plugin to your Tauri app’s src-tauri/Cargo.toml:
src-tauri/Cargo.toml
[dependencies]
tauri-plugin-configurate = "0.4.1"
Replace "0.4.1" with the latest published version. Check crates.io for the current release.

Registering the plugin

Call tauri_plugin_configurate::init() inside your Tauri Builder chain. This is the only Rust-side change required:
fn main() {
    tauri::Builder::default()
        .plugin(tauri_plugin_configurate::init())
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

What init() does

The init() function returns a TauriPlugin<R> built with Tauri’s plugin Builder. When the plugin is registered, Tauri performs the following setup:
  1. Registers IPC command handlers — all 16 commands listed below become callable from the TypeScript frontend via invoke("plugin:configurate|<name>").
  2. Initializes the Configurate state — a platform-specific Configurate<R> struct is created and managed through Tauri’s state system.
  3. Initializes the file-lock registry — a FileLockRegistry is managed to serialize concurrent access to individual config files within the process.
  4. Initializes the backup registry — a BackupRegistry is managed to track rolling backup files and clean them up on exit.
  5. Initializes the file watcher — a WatcherState is created to support the watch_file / unwatch_file commands.
  6. Registers an exit handler — when the Tauri app exits, all rolling backup files tracked by the backup registry are cleaned up automatically.
// The full init() implementation from src/lib.rs
pub fn init<R: Runtime>() -> TauriPlugin<R> {
    Builder::new("configurate")
        .invoke_handler(tauri::generate_handler![
            commands::create,
            commands::load,
            commands::save,
            commands::patch,
            commands::delete,
            commands::exists,
            commands::load_all,
            commands::save_all,
            commands::patch_all,
            commands::unlock,
            commands::watch_file,
            commands::unwatch_file,
            commands::list_configs,
            commands::reset,
            commands::export_config,
            commands::import_config,
        ])
        .setup(|app, api| {
            #[cfg(mobile)]
            let configurate = mobile::init(app, api)?;
            #[cfg(desktop)]
            let configurate = desktop::init(app, api)?;
            app.manage(configurate);
            app.manage(locker::FileLockRegistry::new());
            app.manage(std::sync::Arc::new(storage::BackupRegistry::new()));
            let watcher_state = watcher::WatcherState::new(app.clone())?;
            app.manage(watcher_state);
            Ok(())
        })
        .on_event(|app, event| {
            if let tauri::RunEvent::Exit = event {
                if let Some(registry) = app.try_state::<std::sync::Arc<storage::BackupRegistry>>() {
                    registry.cleanup_all();
                }
            }
        })
        .build()
}

IPC commands exposed

The plugin registers 16 IPC commands. These are called via plugin:configurate|<name> and are invoked automatically by the TypeScript SDK. See IPC commands for the full reference.
CommandTypeScript equivalent
createconfig.create(data).run()
loadconfig.load().run()
saveconfig.save(data).run()
patchconfig.patch(partial).run()
deleteconfig.delete()
existsconfig.exists()
load_allConfigurate.loadAll(entries).run()
save_allConfigurate.saveAll(entries).run()
patch_allConfigurate.patchAll(entries).run()
unlocklocked.unlock(opts)
watch_fileconfig.watchExternal(cb)
unwatch_filestop function returned by watchExternal
list_configsconfig.list()
resetconfig.reset(data).run()
export_configconfig.exportAs(format)
import_configconfig.importFrom(content, format)

ConfigurateExt trait

The plugin also exposes a ConfigurateExt<R> trait that lets you access the underlying Configurate<R> state from any Tauri handle type (App, AppHandle, or Window):
use tauri_plugin_configurate::ConfigurateExt;

// Inside a Tauri command or event handler
fn my_command(app: tauri::AppHandle) {
    let _configurate = app.configurate();
}
This is an advanced escape hatch for Rust-side integrations. Most apps interact with the plugin exclusively from TypeScript.

Build docs developers (and LLMs) love