Skip to main content
A provider controls the file format and optional encryption that tauri-plugin-configurate uses when reading and writing your config. You create a provider by calling one of the four factory functions below and passing the result to the provider option of the Configurate constructor. Each factory returns a frozen, branded ConfigurateProvider object; you cannot construct one by hand.

Providers at a glance


JsonProvider()

Creates a plain JSON storage provider. Config files are pretty-printed, making them easy to inspect in a text editor or version control system.
ConfigurateProvider
A frozen provider object with kind: "json".

YmlProvider()

Creates a YAML storage provider. Config files are written as standard YAML, which supports comments and is widely used for human-authored configuration.
ConfigurateProvider
A frozen provider object with kind: "yml".

TomlProvider()

Creates a TOML storage provider. Config files are written as TOML, which is favored for its strict specification and clear key-value syntax.
ConfigurateProvider
A frozen provider object with kind: "toml".
TOML has no native null type. When a config object is saved, any field whose value is null is silently omitted from the TOML file. On the next load(), that key will be absent from the returned data. Use optional() schema fields to model nullable values and rely on the defaults constructor option to supply fallback values on read. Setting a non-optional field to null and saving it will cause that field to disappear on the next load.

BinaryProvider(opts?)

Creates a binary storage provider with optional XChaCha20-Poly1305 encryption. Without an encryptionKey, data is serialized to compact JSON bytes but not encrypted. With an encryptionKey, the bytes are encrypted before writing.
string
Encryption key passed to the key derivation function. Omit this option entirely to store data unencrypted (compact binary JSON). When provided, the file is XChaCha20-Poly1305-encrypted.
"sha256" | "argon2"
Key derivation function to apply to encryptionKey before using it for encryption. Defaults to "sha256" when omitted.
  • "sha256" — Derives the key with a single SHA-256 hash. Fast and appropriate when encryptionKey is already a high-entropy random value (for example, a key retrieved from the OS keyring). Do not use this with a user-entered password.
  • "argon2" — Derives the key with Argon2id, using a per-file random salt stored in the file header. Use this when encryptionKey is a user-entered password or any low-entropy string.
ConfigurateProvider
A frozen provider object with kind: "binary" and the supplied options.
Store the encryption key itself in the OS keyring using a keyring() schema field, then pass it to BinaryProvider at startup. This way the key is never hard-coded in your bundle.
BinaryProvider files are not human-readable. If you need to inspect or migrate the data, use config.exportAs("json") to convert the current content to a readable format.

Full usage examples