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 therust-version declared in the plugin’s own Cargo.toml.
Adding the dependency
Add the plugin to your Tauri app’ssrc-tauri/Cargo.toml:
src-tauri/Cargo.toml
Replace
"0.4.1" with the latest published version. Check crates.io for the current release.Registering the plugin
Calltauri_plugin_configurate::init() inside your Tauri Builder chain. This is the only Rust-side change required:
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:
- Registers IPC command handlers — all 16 commands listed below become callable from the TypeScript frontend via
invoke("plugin:configurate|<name>"). - Initializes the
Configuratestate — a platform-specificConfigurate<R>struct is created and managed through Tauri’s state system. - Initializes the file-lock registry — a
FileLockRegistryis managed to serialize concurrent access to individual config files within the process. - Initializes the backup registry — a
BackupRegistryis managed to track rolling backup files and clean them up on exit. - Initializes the file watcher — a
WatcherStateis created to support thewatch_file/unwatch_filecommands. - Registers an exit handler — when the Tauri app exits, all rolling backup files tracked by the backup registry are cleaned up automatically.
IPC commands exposed
The plugin registers 16 IPC commands. These are called viaplugin:configurate|<name> and are invoked automatically by the TypeScript SDK. See IPC commands for the full reference.
| Command | TypeScript equivalent |
|---|---|
create | config.create(data).run() |
load | config.load().run() |
save | config.save(data).run() |
patch | config.patch(partial).run() |
delete | config.delete() |
exists | config.exists() |
load_all | Configurate.loadAll(entries).run() |
save_all | Configurate.saveAll(entries).run() |
patch_all | Configurate.patchAll(entries).run() |
unlock | locked.unlock(opts) |
watch_file | config.watchExternal(cb) |
unwatch_file | stop function returned by watchExternal |
list_configs | config.list() |
reset | config.reset(data).run() |
export_config | config.exportAs(format) |
import_config | config.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):