Configurate how to serialize and persist your config data. You pass one to the Configurate constructor as the provider option. Providers are opaque branded values — you create them by calling one of the five factory functions exported from tauri-plugin-configurate-api.
Provider comparison
| Provider | Format | Encrypted | Human-readable | Null support |
|---|---|---|---|---|
JsonProvider() | JSON | No | Yes | Yes |
YmlProvider() | YAML | No | Yes | Yes |
TomlProvider() | TOML | No | Yes | Partial — see note below |
BinaryProvider() | Compact JSON bytes | No | No | Yes |
BinaryProvider({ encryptionKey }) | XChaCha20-Poly1305 | Yes | No | Yes |
SqliteProvider() | SQLite database | No | Queryable | Yes |
JsonProvider
JsonProvider() stores config data as a pretty-printed JSON file. It is the most portable format and the simplest choice for configs that do not need encryption or human-hostile storage.
YmlProvider
YmlProvider() stores config data as a YAML file. YAML is human-readable and supports comments if the file is edited by hand.
serde_yml on the Rust side. YAML null values round-trip correctly.
TomlProvider
TomlProvider() stores config data as a TOML file. TOML is readable and a common choice for developer tooling config files.
BinaryProvider
BinaryProvider() serializes config data to a compact (non-pretty) JSON byte stream. Without an encryptionKey, the file is not encrypted — this is useful when you want a smaller file without whitespace, but do not need confidentiality.
BinaryProvider() without an encryptionKey provides no confidentiality. Anyone with file system access can read the config. Use BinaryProvider({ encryptionKey }) or the OS keyring for sensitive values.Encryption with SHA-256 KDF
Pass anencryptionKey string to enable XChaCha20-Poly1305 authenticated encryption. The 32-byte cipher key is derived from your key string by SHA-256, so any high-entropy string is suitable.
[24-byte random nonce][ciphertext + 16-byte Poly1305 authentication tag]
- A fresh random nonce is generated on every write, so identical data produces different ciphertext.
- The Poly1305 tag detects tampering — a modified file fails to decrypt with a clear error.
- This is the default KDF (
"sha256"). It is fast but does not provide brute-force resistance; use a high-entropy key.
Encryption with Argon2id KDF
Setkdf: "argon2" to derive the cipher key using Argon2id instead of SHA-256. Argon2id is a memory-hard password-based KDF that makes brute-force attacks expensive, making it suitable when the encryptionKey is a human-chosen password.
[16-byte random salt][24-byte random nonce][ciphertext + 16-byte Poly1305 tag]
- A new random salt is generated on every write so the same password produces different ciphertext.
- Parameters: m=19456 KiB, t=2, p=1 (Argon2id defaults — moderate cost).
- Write operations are noticeably slower than SHA-256 due to the intentional memory-hardness.
BinaryProvider options summary
| Option | Type | Default | Description |
|---|---|---|---|
encryptionKey | string | undefined | Key or password for encryption. Omit for unencrypted. |
kdf | "sha256" | "argon2" | "sha256" | Key derivation function when encryptionKey is set. |
SqliteProvider
SqliteProvider() stores config data in a SQLite database file. Schema fields are materialized as typed SQLite columns, making the data queryable with standard SQLite tools.
Options
| Option | Type | Default | Description |
|---|---|---|---|
dbName | string | "configurate.db" | SQLite database file name within the resolved base directory. |
tableName | string | "configurate_configs" | Table name inside the database. Only [A-Za-z0-9_] is allowed. |
How SQLite storage works
The plugin derives a column for each leaf field in the schema:Stringfields →TEXTcolumnsNumberfields →REALcolumnsBooleanfields →INTEGERcolumns (0/1)keyring()fields →TEXTcolumns but always stored asNULL(the secret lives in the OS keyring)- Array and nested-object fields → stored as JSON text in a single
TEXTcolumn
CREATE TABLE IF NOT EXISTS on first write. New schema fields are added via ALTER TABLE ADD COLUMN automatically when the schema evolves — existing rows are not affected.
SQLite uses WAL journal mode and PRAGMA synchronous=NORMAL for durability without excessive fsync overhead.
The rolling backup (
backup: true) option has no effect on SqliteProvider — SQLite manages its own durability through WAL mode.watchExternal() (file watching for external changes) also does not work with SqliteProvider and will throw if called.Choosing a provider
JsonProvider
Best default choice. Human-readable, portable, widely supported. Use when the config file might be edited by hand or shared between tools.
YmlProvider
Good for YAML-native ecosystems. Slightly more readable than JSON for nested data. Avoid if
null handling matters and you use TOML-adjacent tooling.BinaryProvider (encrypted)
Use when the config file must be opaque on disk — e.g. for storing tokens or credentials that cannot go in the OS keyring. Prefer Argon2id for user-supplied passwords.
SqliteProvider
Use when you need queryable storage, plan to store many config entries in one database, or want SQLite’s built-in transactional durability.