Getting started

Installation

Add the Rust crate and the npm package, register the plugin and allow its commands.

Requires Rust 1.88 or newer (the platform keyring crates need it) and Tauri 2.

Automatic

From your Tauri app root (where package.json and the tauri script are):

pnpm tauri add keyring-store
# or: npm run tauri add keyring-store · yarn tauri add keyring-store · cargo tauri add keyring-store

The CLI adds the crate to src-tauri, the tauri-plugin-keyring-store-api npm package, and registers the plugin. Then check that your capability has keyring-store:default (see Permissions).

Manual

Rust

cd src-tauri
cargo add tauri-plugin-keyring-store
Cargo.toml
[dependencies]
tauri-plugin-keyring-store = "0.3"

Register the plugin:

src-tauri/src/lib.rs
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
    tauri::Builder::default()
        .plugin(tauri_plugin_keyring_store::init())
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

init() uses the app identifier from tauri.conf.json as the keyring service name. To choose another one, use the builder:

tauri_plugin_keyring_store::Builder::new()
    .service("com.mycompany.myapp.credentials")
    .build()

All entries of the plugin live under this service. Changing it later hides the old entries (they stay in the OS store under the old name).

JavaScript

pnpm add tauri-plugin-keyring-store-api

The package works only together with the Rust plugin above.

Cargo features

FeatureDefaultWhat
cryptoyesSLIP10 / BIP39 / Ed25519 procedures through iota-crypto.

Without the procedures (store, vault records, passwords and backups only):

Cargo.toml
tauri-plugin-keyring-store = { version = "0.3", default-features = false }

The execute_procedure command then rejects with crypto procedure error: tauri-plugin-keyring-store was built without the `crypto` feature. Encrypted backups (Argon2id + ChaCha20-Poly1305) do not depend on this feature.

Permissions

Add the plugin to a capability of the windows that use it:

src-tauri/capabilities/default.json
{
  "identifier": "default",
  "windows": ["main"],
  "permissions": ["core:default", "keyring-store:default"]
}

keyring-store:default allows every command. Read the Permissions guide before you give it to a window that loads remote content.

Platform setup

  • Linux: build needs libdbus-1-dev and pkg-config; at run time a Secret Service must be running. See Linux.
  • iOS: the app must be signed. See iOS.
  • macOS, Windows and Android need nothing extra.