Secrets in the OS keyring for Tauri 2 apps
Store passwords, records and wallet keys in the platform credential store from your Tauri frontend or backend, on desktop, Android and iOS.
What you get
Session, store, vault
Open a session, write a store record, keep a wallet key in the vault. Every call is one entry in the OS keyring under your app service name.
main.ts
import { KeyringSession, Location, setPasswords, getPasswords } from "tauri-plugin-keyring-store-api";
// Plain accounts: one OS keyring entry each.
await setPasswords([{ account: "app.api_token", secret: "s3cr3t" }]);
const [token] = await getPasswords(["app.api_token"]);
// Stronghold-style session, store and vault.
const session = await KeyringSession.load("/wallet/main", "");
const client = await session.createClient("main");
await client.getStore().insert("prefs", new TextEncoder().encode("{}"));
const vault = client.getVault("PRIMARY");
const master = Location.generic("PRIMARY", "master");
const words = new TextDecoder().decode(await vault.generateBIP39(master)); // show once for backup
const signature = await vault.signEd25519(master, "hello"); // 64 bytes