Skip to content

@tauri-apps/plugin-stronghold

Store secrets and keys using the IOTA Stronghold encrypted database and secure runtime.

Defined in: plugins/stronghold/guest-js/index.ts:386

A client of a stronghold snapshot, owning a set of vaults and a key-value store. Clients are obtained with Stronghold.loadClient and Stronghold.createClient.

2.0.0

new Client(path: string, name: ClientPath): Client;

Defined in: plugins/stronghold/guest-js/index.ts:406

Creates a client handle for a client that was already loaded or created. Prefer Stronghold.loadClient and Stronghold.createClient, which also register the client on the Rust side.

import { Client } from '@tauri-apps/plugin-stronghold';
const client = new Client('/path/to/snapshot.hold', 'my-client');
Parameter Type Description
path string The path of the snapshot file the client belongs to.
name ClientPath The name identifying the client inside the snapshot.

Client

Property Type Description Defined in
name ClientPath The name identifying this client inside the snapshot. plugins/stronghold/guest-js/index.ts:390
path string The path of the snapshot file this client belongs to. plugins/stronghold/guest-js/index.ts:388

getStore(): Store;

Defined in: plugins/stronghold/guest-js/index.ts:443

Gets a handle to the key-value store of this client.

import { Stronghold } from '@tauri-apps/plugin-stronghold';
const stronghold = await Stronghold.load('/path/to/snapshot.hold', 'password');
const client = await stronghold.createClient('my-client');
const store = client.getStore();

Store

The store handle.

getVault(name: VaultPath): Vault;

Defined in: plugins/stronghold/guest-js/index.ts:426

Gets a handle to the vault with the given name. The vault is created on the Rust side when the first secret is written to it.

import { Stronghold } from '@tauri-apps/plugin-stronghold';
const stronghold = await Stronghold.load('/path/to/snapshot.hold', 'password');
const client = await stronghold.createClient('my-client');
const vault = client.getVault('my-vault');
Parameter Type Description
name VaultPath The path of the vault.

Vault

The vault handle.


Defined in: plugins/stronghold/guest-js/index.ts:163

A pointer to a record inside a vault, either addressed by its record path (Location.generic) or by a counter (Location.counter).

2.0.0

new Location(type: string, payload: Record<string, unknown>): Location;

Defined in: plugins/stronghold/guest-js/index.ts:182

Creates a location of the given kind. Prefer the Location.generic and Location.counter helpers, which fill the payload for you.

import { Location } from '@tauri-apps/plugin-stronghold';
const location = new Location('Generic', { vault: 'my-vault', record: 'my-record' });
Parameter Type Description
type string The location kind, either Generic or Counter.
payload Record<string, unknown> The data identifying the record inside the vault.

Location

Property Type Description Defined in
payload Record<string, unknown> The location data, holding the vault path and the record path or counter. plugins/stronghold/guest-js/index.ts:167
type string The location kind, either Generic or Counter. plugins/stronghold/guest-js/index.ts:165

static counter(vault: VaultPath, counter: number): Location;

Defined in: plugins/stronghold/guest-js/index.ts:220

Creates a location addressing a record of a vault by a counter.

import { Location } from '@tauri-apps/plugin-stronghold';
const location = Location.counter('my-vault', 0);
Parameter Type Description
vault VaultPath The path of the vault holding the record.
counter number The counter identifying the record inside the vault.

Location

The location of the record.

static generic(vault: VaultPath, record: RecordPath): Location;

Defined in: plugins/stronghold/guest-js/index.ts:200

Creates a location addressing a record of a vault by its record path.

import { Location } from '@tauri-apps/plugin-stronghold';
const location = Location.generic('my-vault', 'my-record');
Parameter Type Description
vault VaultPath The path of the vault holding the record.
record RecordPath The path of the record inside the vault.

Location

The location of the record.


Defined in: plugins/stronghold/guest-js/index.ts:454

The key-value store of a Client. Unlike a Vault, the values stored here can be read back directly.

2.0.0

new Store(path: string, client: ClientPath): Store;

Defined in: plugins/stronghold/guest-js/index.ts:473

Creates a store handle for a client that was already loaded or created. Prefer Client.getStore.

import { Store } from '@tauri-apps/plugin-stronghold';
const store = new Store('/path/to/snapshot.hold', 'my-client');
Parameter Type Description
path string The path of the snapshot file the store belongs to.
client ClientPath The name of the client owning the store.

Store

Property Type Description Defined in
client ClientPath The name of the client owning this store. plugins/stronghold/guest-js/index.ts:458
path string The path of the snapshot file this store belongs to. plugins/stronghold/guest-js/index.ts:456

get(key: StoreKey): Promise<
| Uint8Array
| null>;

Defined in: plugins/stronghold/guest-js/index.ts:492

Reads the value of a record of this store.

import { Stronghold } from '@tauri-apps/plugin-stronghold';
const stronghold = await Stronghold.load('/path/to/snapshot.hold', 'password');
const client = await stronghold.createClient('my-client');
const value = await client.getStore().get('my-key');
Parameter Type Description
key StoreKey The key of the record.

Promise< | Uint8Array | null>

A promise resolving to the stored value, or null if the key does not exist.

insert(
key: StoreKey,
value: number[],
lifetime?: Duration
): Promise<void>;

Defined in: plugins/stronghold/guest-js/index.ts:518

Inserts a record in this store, replacing the previous value of the key. Note that the snapshot is only persisted when Stronghold.save is called.

import { Stronghold } from '@tauri-apps/plugin-stronghold';
const stronghold = await Stronghold.load('/path/to/snapshot.hold', 'password');
const client = await stronghold.createClient('my-client');
const data = Array.from(new TextEncoder().encode('Hello, World!'));
await client.getStore().insert('my-key', data);
await stronghold.save();
Parameter Type Description
key StoreKey The key of the record.
value number[] The value of the record, as an array of bytes.
lifetime? Duration The optional duration after which the record expires.

Promise<void>

remove(key: StoreKey): Promise<
| Uint8Array
| null>;

Defined in: plugins/stronghold/guest-js/index.ts:546

Deletes a record from this store.

import { Stronghold } from '@tauri-apps/plugin-stronghold';
const stronghold = await Stronghold.load('/path/to/snapshot.hold', 'password');
const client = await stronghold.createClient('my-client');
await client.getStore().remove('my-key');
Parameter Type Description
key StoreKey The key of the record.

Promise< | Uint8Array | null>

A promise resolving to the deleted value, or null if the key did not exist.


Defined in: plugins/stronghold/guest-js/index.ts:656

A representation of an access to a stronghold.

2.0.0

Property Type Description Defined in
path string The path of the snapshot file backing this stronghold. plugins/stronghold/guest-js/index.ts:658

createClient(client: ClientPath): Promise<Client>;

Defined in: plugins/stronghold/guest-js/index.ts:744

Creates a new empty client on this stronghold.

import { Stronghold } from '@tauri-apps/plugin-stronghold';
const stronghold = await Stronghold.load('/path/to/snapshot.hold', 'password');
let client;
try {
client = await stronghold.loadClient('my-client');
} catch {
client = await stronghold.createClient('my-client');
}
Parameter Type Description
client ClientPath The name of the client.

Promise<Client>

A promise resolving to the created client.

loadClient(client: ClientPath): Promise<Client>;

Defined in: plugins/stronghold/guest-js/index.ts:719

Loads an existing client from the snapshot. The promise rejects if the client does not exist in the snapshot or was already loaded.

import { Stronghold } from '@tauri-apps/plugin-stronghold';
const stronghold = await Stronghold.load('/path/to/snapshot.hold', 'password');
const client = await stronghold.loadClient('my-client');
Parameter Type Description
client ClientPath The name of the client.

Promise<Client>

A promise resolving to the loaded client.

save(): Promise<void>;

Defined in: plugins/stronghold/guest-js/index.ts:763

Persists the stronghold state to the snapshot.

import { Stronghold } from '@tauri-apps/plugin-stronghold';
const stronghold = await Stronghold.load('/path/to/snapshot.hold', 'password');
const client = await stronghold.createClient('my-client');
await client.getStore().insert('my-key', [1, 2, 3]);
await stronghold.save();

Promise<void>

unload(): Promise<void>;

Defined in: plugins/stronghold/guest-js/index.ts:699

Saves the snapshot and removes this instance from the cache.

import { Stronghold } from '@tauri-apps/plugin-stronghold';
const stronghold = await Stronghold.load('/path/to/snapshot.hold', 'password');
await stronghold.unload();

Promise<void>

static load(path: string, password: string): Promise<Stronghold>;

Defined in: plugins/stronghold/guest-js/index.ts:682

Load the snapshot if it exists (password must match), or start a fresh stronghold instance otherwise.

import { Stronghold } from '@tauri-apps/plugin-stronghold';
import { appDataDir } from '@tauri-apps/api/path';
const stronghold = await Stronghold.load(`${await appDataDir()}/vault.hold`, 'password');
Parameter Type Description
path string The path of the snapshot file.
password string The password used to encrypt and decrypt the snapshot.

Promise<Stronghold>

A promise resolving to the stronghold instance.


Defined in: plugins/stronghold/guest-js/index.ts:565

A key-value storage that allows create, update and delete operations. It does not allow reading the data, so one of the procedures must be used to manipulate the stored data, allowing secure storage of secrets.

2.0.0

  • ProcedureExecutor

new Vault(
path: string,
client: ClientPath,
name: VaultPath
): Vault;

Defined in: plugins/stronghold/guest-js/index.ts:587

Creates a vault handle for a client that was already loaded or created. Prefer Client.getVault.

import { Vault } from '@tauri-apps/plugin-stronghold';
const vault = new Vault('/path/to/snapshot.hold', 'my-client', 'my-vault');
Parameter Type Description
path string The path of the snapshot file the vault belongs to.
client ClientPath The name of the client owning the vault.
name VaultPath The path identifying the vault inside the client.

Vault

ProcedureExecutor.constructor
Property Type Description Inherited from Defined in
client ClientPath The name of the client owning this vault. - plugins/stronghold/guest-js/index.ts:569
name VaultPath The path identifying this vault inside the client. - plugins/stronghold/guest-js/index.ts:571
path string The path of the snapshot file this vault belongs to. - plugins/stronghold/guest-js/index.ts:567
procedureArgs Record<string, unknown> - ProcedureExecutor.procedureArgs plugins/stronghold/guest-js/index.ts:229

deriveSLIP10(
chain: number[],
source: "Seed" | "Key",
sourceLocation: Location,
outputLocation: Location
): Promise<Uint8Array>;

Defined in: plugins/stronghold/guest-js/index.ts:266

Derive a SLIP10 private key using a seed or key. The derivation is always performed on the Ed25519 curve.

Parameter Type Description
chain number[] The chain path.
source "Seed" | "Key" The source type, either ‘Seed’ or ‘Key’.
sourceLocation Location The source location, must be the outputLocation of a previous call to generateSLIP10Seed or deriveSLIP10.
outputLocation Location Location of the record where the private key will be stored.

Promise<Uint8Array>

A promise resolving to the bytes returned by the procedure.

ProcedureExecutor.deriveSLIP10

generateBIP39(outputLocation: Location, passphrase?: string): Promise<Uint8Array>;

Defined in: plugins/stronghold/guest-js/index.ts:319

Generate a BIP39 seed. The mnemonic is generated in English.

Parameter Type Description
outputLocation Location The location of the record where the BIP39 seed will be stored.
passphrase? string The optional mnemonic passphrase.

Promise<Uint8Array>

A promise resolving to the bytes returned by the procedure.

ProcedureExecutor.generateBIP39

generateSLIP10Seed(outputLocation: Location, sizeBytes?: number): Promise<Uint8Array>;

Defined in: plugins/stronghold/guest-js/index.ts:241

Generate a SLIP10 seed for the given location.

Parameter Type Description
outputLocation Location Location of the record where the seed will be stored.
sizeBytes? number The size in bytes of the SLIP10 seed.

Promise<Uint8Array>

A promise resolving to the bytes returned by the procedure.

ProcedureExecutor.generateSLIP10Seed

getEd25519PublicKey(privateKeyLocation: Location): Promise<Uint8Array>;

Defined in: plugins/stronghold/guest-js/index.ts:342

Gets the Ed25519 public key of a SLIP10 private key.

Parameter Type Description
privateKeyLocation Location The location of the private key. Must be the outputLocation of a previous call to deriveSLIP10.

Promise<Uint8Array>

A promise resolving to the public key hex string.

2.0.0

ProcedureExecutor.getEd25519PublicKey

insert(recordPath: RecordPath, secret: number[]): Promise<void>;

Defined in: plugins/stronghold/guest-js/index.ts:615

Writes a secret to this vault. Note that the snapshot is only persisted when Stronghold.save is called.

import { Stronghold } from '@tauri-apps/plugin-stronghold';
const stronghold = await Stronghold.load('/path/to/snapshot.hold', 'password');
const client = await stronghold.createClient('my-client');
const secret = Array.from(new TextEncoder().encode('secret value'));
await client.getVault('my-vault').insert('my-record', secret);
await stronghold.save();
Parameter Type Description
recordPath RecordPath The path of the record inside this vault.
secret number[] The secret to store, as an array of bytes.

Promise<void>

recoverBIP39(
mnemonic: string,
outputLocation: Location,
passphrase?: string
): Promise<Uint8Array>;

Defined in: plugins/stronghold/guest-js/index.ts:295

Store a BIP39 mnemonic.

Parameter Type Description
mnemonic string The mnemonic string.
outputLocation Location The location of the record where the BIP39 mnemonic will be stored.
passphrase? string The optional mnemonic passphrase.

Promise<Uint8Array>

A promise resolving to the bytes returned by the procedure.

ProcedureExecutor.recoverBIP39

remove(location: Location): Promise<void>;

Defined in: plugins/stronghold/guest-js/index.ts:641

Deletes a secret from this vault. Only the record path of the given location is used, the vault is always this one.

import { Stronghold, Location } from '@tauri-apps/plugin-stronghold';
const stronghold = await Stronghold.load('/path/to/snapshot.hold', 'password');
const client = await stronghold.createClient('my-client');
await client
.getVault('my-vault')
.remove(Location.generic('my-vault', 'my-record'));
Parameter Type Description
location Location The location of the record to delete.

Promise<void>

signEd25519(privateKeyLocation: Location, msg: string): Promise<Uint8Array>;

Defined in: plugins/stronghold/guest-js/index.ts:363

Creates a Ed25519 signature from a private key.

Parameter Type Description
privateKeyLocation Location The location of the record where the private key is stored. Must be the outputLocation of a previous call to deriveSLIP10.
msg string The message to sign.

Promise<Uint8Array>

A promise resolving to the signature hex string.

2.0.0

ProcedureExecutor.signEd25519

Defined in: plugins/stronghold/guest-js/index.ts:82

The address book of the peer-to-peer network. See NetworkConfig for a note on how these definitions are used.

Property Type Description Defined in
peers Map<string, PeerAddress> The known addresses of each peer, keyed by the peer identifier. plugins/stronghold/guest-js/index.ts:84
relays string[] The identifiers of the peers that can be used as relays. plugins/stronghold/guest-js/index.ts:86

Defined in: plugins/stronghold/guest-js/index.ts:93

The operations a remote peer is allowed to perform on a client. See NetworkConfig for a note on how these definitions are used.

Property Type Description Defined in
cloneVaultDefault? boolean The default permission to clone the secrets of a vault. plugins/stronghold/guest-js/index.ts:103
cloneVaultExceptions? Map<VaultPath, boolean> Per-vault overrides of ClientAccess.cloneVaultDefault. plugins/stronghold/guest-js/index.ts:105
readStore? boolean Whether the store of the client can be read. plugins/stronghold/guest-js/index.ts:107
useVaultDefault? boolean The default permission to use the secrets stored in a vault. plugins/stronghold/guest-js/index.ts:95
useVaultExceptions? Map<VaultPath, boolean> Per-vault overrides of ClientAccess.useVaultDefault. plugins/stronghold/guest-js/index.ts:97
writeStore? boolean Whether the store of the client can be written to. plugins/stronghold/guest-js/index.ts:109
writeVaultDefault? boolean The default permission to write secrets to a vault. plugins/stronghold/guest-js/index.ts:99
writeVaultExceptions? Map<VaultPath, boolean> Per-vault overrides of ClientAccess.writeVaultDefault. plugins/stronghold/guest-js/index.ts:101

Defined in: plugins/stronghold/guest-js/index.ts:52

The limits applied to the connections of a Stronghold peer-to-peer network. See NetworkConfig for a note on how these definitions are used.

Property Type Description Defined in
maxEstablishedIncoming? number The maximum number of established incoming connections. plugins/stronghold/guest-js/index.ts:58
maxEstablishedOutgoing? number The maximum number of established outgoing connections. plugins/stronghold/guest-js/index.ts:60
maxEstablishedPerPeer? number The maximum number of established connections per peer. plugins/stronghold/guest-js/index.ts:62
maxEstablishedTotal? number The maximum number of established connections, incoming and outgoing combined. plugins/stronghold/guest-js/index.ts:64
maxPendingIncoming? number The maximum number of incoming connections that can be pending at the same time. plugins/stronghold/guest-js/index.ts:54
maxPendingOutgoing? number The maximum number of outgoing connections that can be pending at the same time. plugins/stronghold/guest-js/index.ts:56

Defined in: plugins/stronghold/guest-js/index.ts:150

A duration definition.

Property Type Description Defined in
nanos number The fractional part of this Duration, in nanoseconds. Must be greater or equal to 0 and smaller than 1e+9 (the max number of nanoseoncds in a second) plugins/stronghold/guest-js/index.ts:154
secs number The number of whole seconds contained by this Duration. plugins/stronghold/guest-js/index.ts:152

Defined in: plugins/stronghold/guest-js/index.ts:130

The configuration of the Stronghold peer-to-peer network.

These definitions mirror the networking options of IOTA Stronghold. The plugin does not currently expose a command that consumes them, so they are only useful as type definitions.

Property Type Description Defined in
addresses? AddressInfo The addresses of the known peers and of the available relays. plugins/stronghold/guest-js/index.ts:142
connectionsLimit? ConnectionLimits The limits applied to pending and established connections. plugins/stronghold/guest-js/index.ts:136
connectionTimeout? Duration The maximum time to wait when establishing a connection to a peer. plugins/stronghold/guest-js/index.ts:134
enableMdns? boolean Whether peers on the local network are discovered through mDNS. plugins/stronghold/guest-js/index.ts:138
enableRelay? boolean Whether connections relayed by another peer are enabled. plugins/stronghold/guest-js/index.ts:140
peerPermissions? Map<string, Permissions> The permissions granted to specific peers, keyed by the peer identifier. plugins/stronghold/guest-js/index.ts:144
permissionsDefault? Permissions The permissions granted to the peers that have no entry in NetworkConfig.peerPermissions. plugins/stronghold/guest-js/index.ts:146
requestTimeout? Duration The maximum time to wait for the response to an outbound request. plugins/stronghold/guest-js/index.ts:132

Defined in: plugins/stronghold/guest-js/index.ts:71

The addresses on which a remote peer can be reached. See NetworkConfig for a note on how these definitions are used.

Property Type Description Defined in
known string[] The addresses that are known for the peer, in the multiaddr format. plugins/stronghold/guest-js/index.ts:73
use_relay_fallback boolean Whether the peer may be reached through a relay when its known addresses cannot be used. plugins/stronghold/guest-js/index.ts:75

Defined in: plugins/stronghold/guest-js/index.ts:116

The access a remote peer is granted on the clients of a snapshot. See NetworkConfig for a note on how these definitions are used.

Property Type Description Defined in
default? ClientAccess The access granted when no exception matches. plugins/stronghold/guest-js/index.ts:118
exceptions? Map<VaultPath, ClientAccess> The access granted for specific paths, overriding Permissions.default. plugins/stronghold/guest-js/index.ts:120

type ClientPath =
| string
| Iterable<number>
| ArrayLike<number>
| ArrayBuffer;

Defined in: plugins/stronghold/guest-js/index.ts:17

The name of a Stronghold client, either as a UTF-8 string or as its raw byte representation.


type RecordPath =
| string
| Iterable<number>
| ArrayLike<number>
| ArrayBuffer;

Defined in: plugins/stronghold/guest-js/index.ts:33

The path of a record inside a vault, either as a UTF-8 string or as its raw byte representation.


type StoreKey =
| string
| Iterable<number>
| ArrayLike<number>
| ArrayBuffer;

Defined in: plugins/stronghold/guest-js/index.ts:42

The key of a record in a client store. Note that the store commands read the key as a string on the Rust side, so string keys are the safe choice.


type VaultPath =
| string
| Iterable<number>
| ArrayLike<number>
| ArrayBuffer;

Defined in: plugins/stronghold/guest-js/index.ts:25

The path of a vault inside a client, either as a UTF-8 string or as its raw byte representation.


© 2026 Tauri Contributors. CC-BY / MIT