interface · Browser

# VaultConfig

`@toip-tools/web-vault` · [View source](https://github.com/yourbuddyconner/toip-tools/blob/main/packages/web-vault/src/vault.ts#L47)

Import:

```ts
import { type VaultConfig } from "@toip-tools/web-vault";
```

## Declaration

interface:

```ts
interface VaultConfig {
  /** Storage key prefix, one per app on an origin: letters, digits and dashes. */
  prefix: string;
  /** The passkey's relying-party name, shown in the passkey prompt. Default: the prefix. */
  rpName?: string;
  /** HKDF salt for the passkey-derived key. Default `<prefix>/account-key/v1`. */
  hkdfSalt?: string;
  /** Backup code prefix. Default `<prefix>-key-1-`. */
  backupPrefix?: string;
  /** PBKDF2 rounds for new passphrase locks. Default 600,000. */
  pbkdf2Rounds?: number;
  /** The account's DID from its seed. Default: the trust core's did:key. */
  didOf?: (seed: Uint8Array) => string;
  /** Default: `localStorage`. */
  storage?: Storage;
  /** Default: `navigator.credentials`. */
  credentials?: Pick<CredentialsContainer, "create" | "get">;
  /** The relying-party id. Default: `location.hostname`. */
  rpId?: string;
  /** Where CryptoKeys are kept. Default: `indexedDB`. */
  indexedDB?: IDBFactory;
}
```

## Properties

**`prefix` (required)**

`string`

Storage key prefix, one per app on an origin: letters, digits and dashes.

**`rpName` (optional)**

`string | undefined`

The passkey's relying-party name, shown in the passkey prompt. Default: the prefix.

**`hkdfSalt` (optional)**

`string | undefined`

HKDF salt for the passkey-derived key. Default `<prefix>/account-key/v1`.

**`backupPrefix` (optional)**

`string | undefined`

Backup code prefix. Default `<prefix>-key-1-`.

**`pbkdf2Rounds` (optional)**

`number | undefined`

PBKDF2 rounds for new passphrase locks. Default 600,000.

**`didOf` (optional)**

`((seed: Uint8Array) => string) | undefined`

The account's DID from its seed. Default: the trust core's did:key.

**`storage` (optional)**

`Storage | undefined`

Default: `localStorage`.

**`credentials` (optional)**

`Pick<CredentialsContainer, "create" | "get"> | undefined`

Default: `navigator.credentials`.

**`rpId` (optional)**

`string | undefined`

The relying-party id. Default: `location.hostname`.

**`indexedDB` (optional)**

`IDBFactory | undefined`

Where CryptoKeys are kept. Default: `indexedDB`.

[Usage guide](https://toip.tools/toolkit/web-vault/#usage) · [Error handling](https://toip.tools/toolkit/web-vault/#errors) · [All exports](https://toip.tools/toolkit/web-vault/api/)

---

This is the Markdown version of https://toip.tools/toolkit/web-vault/api/VaultConfig/. An index of the documentation for AI assistants is at https://toip.tools/llms.txt.
