Skip to contentMenu Download OpenVireo

With offline: true, an Account keeps what this device needs to unlock and open vaults without the network, and keeps edits made offline until they can be uploaded.

import { Account, isUnreachable } from "@openvireo/sdk";

const account = await Account.connect({
  issuer,
  device: { name: "Web", platform: "web" },
  storage: browserStorage(),
  offline: true,
});
await account.unlock(password);              // works offline from the cached wrapped keyset
const vault = await account.openVault(id);   // offline: the local copy
account.offline;                             // true while the servers can't be reached

await vault.write("ov://Home/Wifi/password", "new").catch((e) => {
  if (!isUnreachable(e)) throw e;            // offline: the edit is kept and merges in later
});

const { vaults, dropped } = await account.reconnect();   // back online; revoked vaults are forgotten
await vault.sync();                                       // uploads the kept edit

What falls back

connect, unlock, listVaults and openVault use the cache when a server can’t be reached: isUnreachable(e) is true, meaning no network or a 502, 503 or 504 from a gateway. Any other error, such as a wrong password or a revoked session, still throws. account.offline and vault.offline say which state you are in.

A vault that was never synced on this device can’t be opened offline (not_available_offline).

What is cached

Only what the servers store too, so the cache is no weaker than the server’s copy:

  • the discovery document;
  • the wrapped keyset and its KDF parameters;
  • the vault list as the server returned it (encrypted names, sealed keys);
  • per vault, the sync state, whose base copy is the server’s encrypted .kdbx;
  • per vault, local edits not yet uploaded, as a .kdbx encrypted with the vault key.

Unlocking offline still needs the master password and the Secret Key (kept on trusted devices). Signing out, and a session the server rejects, drop the whole cache. reconnect() drops vaults the account can no longer open and returns their ids in dropped.

The SDK docs cover OpenVireo SDK, develop (86e6cd2), last updated 26 October 2026. Found a mistake? Edit this page on GitHub.