Skip to main content
tauri-plugin-configurate is a Tauri v2 plugin that brings type-safe, schema-driven configuration management to your desktop app. Define your config shape once with defineConfig(), choose a storage backend, and let TypeScript infer all your value types — no boilerplate, no runtime surprises. Sensitive fields like API keys and passwords are marked with keyring() and stored in the OS keyring (Windows Credential Manager, macOS Keychain, or Linux Secret Service) — they never touch disk.

Quickstart

Get a working config up and running in under 5 minutes

Installation

Add the Rust plugin and TypeScript API to your Tauri project

Core Concepts

Understand schemas, providers, keyring, and path resolution

API Reference

Explore the full TypeScript and Rust API surface

Key features

Type-safe schemas

defineConfig() gives you full TypeScript inference — no casting, no any

OS keyring integration

Mark fields with keyring() and secrets are stored in the platform keyring, never on disk

Multiple storage backends

Choose JSON, YAML, TOML, encrypted Binary (XChaCha20-Poly1305), or SQLite

Fluent builder API

Chainable .lock(), .unlock(), .createIfMissing() on every operation

Batch operations

loadAll / saveAll / patchAll in a single IPC round-trip

File watching

React to external changes or in-app events with watchExternal and onChange

Export and Import

Convert configs between JSON, YAML, and TOML on the fly

Schema migrations

Version your schema and auto-migrate old configs on load

Get started in 3 steps

1

Install the plugin

Add both the Rust crate and the npm package to your Tauri project.
# Using Tauri CLI (installs both automatically)
npm tauri add configurate
See the full installation guide for manual setup.
2

Define your schema

Use defineConfig() to describe your configuration shape. Mark sensitive values with keyring().
import { defineConfig, keyring, optional } from "tauri-plugin-configurate-api";

const appSchema = defineConfig({
  theme: String,
  language: String,
  fontSize: optional(Number),
  database: {
    host: String,
    password: keyring(String, { id: "db-password" }),
  },
});
3

Create a Configurate instance and use it

Pick a provider and start reading and writing your config.
import { BaseDirectory, Configurate, JsonProvider } from "tauri-plugin-configurate-api";

const config = new Configurate({
  schema: appSchema,
  fileName: "app.json",
  baseDir: BaseDirectory.AppConfig,
  provider: JsonProvider(),
});

const KEYRING = { service: "my-app", account: "default" };

// Create
await config.create({ theme: "dark", language: "en", database: { host: "localhost", password: "secret" } })
  .lock(KEYRING)
  .run();

// Load (unlocked)
const unlocked = await config.load().unlock(KEYRING);
console.log(unlocked.data.database.password); // "secret"
tauri-plugin-configurate is pre-release software (0.x). Breaking changes may be introduced in any minor version. Pin to an exact version in production and review release notes before upgrading.

Build docs developers (and LLMs) love