toip.tools

interface · Browser

VaultConfig

@toip-tools/web-vaultView source
TypeScriptImport
import { type VaultConfig } from "@toip-tools/web-vault";

Declaration

TypeScriptinterface
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

prefixrequired
string

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

rpNameoptional
string | undefined

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

hkdfSaltoptional
string | undefined

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

backupPrefixoptional
string | undefined

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

pbkdf2Roundsoptional
number | undefined

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

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

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

storageoptional
Storage | undefined

Default: localStorage.

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

Default: navigator.credentials.

rpIdoptional
string | undefined

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

indexedDBoptional
IDBFactory | undefined

Where CryptoKeys are kept. Default: indexedDB.