Skip to main content
Version: 5.0

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 sessionStorage.

Represents a vault implementation for browser compatibility.

Constructors

constructor

Usage


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

Parameters

NameType
config?IdentityVaultConfig

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>

initialize

Usage


_10
vault.initialize({
_10
key: 'com.company.myvaultapp',
_10
type: 'CustomPasscode',
_10
deviceSecurityType: 'Both',
_10
lockAfterBackgrounded: 2000,
_10
});

Parameters

NameType
configIdentityVaultConfig

Returns: Promise<void>

isEmpty

See Vault.isEmpty

Returns: Promise<boolean>

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
callbackCallback<VaultLockEvent>

Returns: void

onPasscodeRequested

See Vault.onPasscodeRequested

Parameters

NameType
callback(isPasscodeSetRequest: boolean, onComplete: (code: string) => void) => void

Returns: void

Parameters

NameType
callback(isPasscodeSetRequest: boolean) => Promise<void>

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>