interface · Browser
VaultConfig
@toip-tools/web-vaultView sourceimport { type VaultConfig } from "@toip-tools/web-vault";
Declaration
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
prefixrequiredstringStorage key prefix, one per app on an origin: letters, digits and dashes.
rpNameoptionalstring | undefinedThe passkey's relying-party name, shown in the passkey prompt. Default: the prefix.
hkdfSaltoptionalstring | undefinedHKDF salt for the passkey-derived key. Default
<prefix>/account-key/v1.backupPrefixoptionalstring | undefinedBackup code prefix. Default
<prefix>-key-1-.pbkdf2Roundsoptionalnumber | undefinedPBKDF2 rounds for new passphrase locks. Default 600,000.
didOfoptional((seed: Uint8Array) => string) | undefinedThe account's DID from its seed. Default: the trust core's did:key.
storageoptionalStorage | undefinedDefault:
localStorage.credentialsoptionalPick<CredentialsContainer, "create" | "get"> | undefinedDefault:
navigator.credentials.rpIdoptionalstring | undefinedThe relying-party id. Default:
location.hostname.indexedDBoptionalIDBFactory | undefinedWhere CryptoKeys are kept. Default:
indexedDB.