Skip to main content
Version: 5.0.0-beta

BrowserVault

THIS VAULT DOES NOT IMPLEMENT SECURE STORAGE IN THE BROWSER. It only exists as a way to run browser-compatible code in place of Identity Vault. Browsers do not have a secure storage element same as native devices. This class is intended to be used to enable running your application in the browser while simulating the functions of Identity Vault using localstorage.

Represents a vault implementation for browser compatibility.

Constructors#

constructor#

Usage#

const vault = new Vault({
key: 'com.company.myvaultapp',
type: 'CustomPasscode',
deviceSecurityType: 'Both',
lockAfterBackgrounded: 2000,
});

Parameters#

NameType
configIdentityVaultConfig

Returns: BrowserVault

Methods#

clear#

See Vault.clear

Returns: Promise<void>

doesVaultExist#

See Vault.doesVaultExist

Returns: Promise<boolean>

exportVault#

See Vault.exportVault

Returns: Promise<Record<string, string>>

getKeys#

See Vault.getKeys

Returns: Promise<string[]>

getValue#

See Vault.getValue

Parameters#

NameType
keystring

Returns: Promise<null | T>

importVault#

See Vault.importVault

Parameters#

NameType
dataRecord<string, string>

Returns: Promise<void>

isLocked#

See Vault.isLocked

Returns: Promise<boolean>

lock#

See Vault.lock

Returns: Promise<void>

onConfigChanged#

See Vault.onConfigChanged

Parameters#

NameType
callbackCallback<IdentityVaultConfig>

Returns: void

onError#

See Vault.onError

Parameters#

NameType
callbackCallback<VaultError>

Returns: void

onLock#

See Vault.onLock

Parameters#

NameType
callbackEmptyCallback

Returns: void

onPasscodeRequested#

See Vault.onPasscodeRequested

Parameters#

NameType
callbackCallback<boolean>

Returns: void

onUnlock#

See Vault.onUnlock

Parameters#

NameType
callbackEmptyCallback

Returns: void

removeValue#

See Vault.removeValue

Parameters#

NameType
keystring

Returns: Promise<void>

setCustomPasscode#

See Vault.setCustomPasscode

Parameters#

NameType
passcodestring

Returns: Promise<void>

setValue#

See Vault.setValue

Parameters#

NameType
keystring
valueT

Returns: Promise<void>

unlock#

See Vault.unlock

Returns: Promise<void>

updateConfig#

See Vault.updateConfig

Parameters#

NameType
configIdentityVaultConfig

Returns: Promise<void>