Skip to main content
Version: 5.0

VaultMigrator

Constructors

constructor

Usage


_10
const legacyVaultConfig = {
_10
unlockOnAccess: true,
_10
hideScreenOnBackground: true,
_10
lockAfter: 5000,
_10
// and more ....
_10
}
_10
const migrator = new VaultMigrator(legacyVaultConfig, customPasscodePrompt);

Parameters

NameTypeDescription
optionsVaultOptionsThe legacy vault configuration options
onPasscodeRequest?(isPasscodeSetRequest: boolean) => Promise<undefined | string>An optional callback function that will be called when the vault attempts to request a passcode. The function returns a promise with a boolean that indicates if the passcode is being setup for the first time for the vault or not.
descriptor?VaultDescriptorAn optional interface that describes the legacy vault.

Returns: VaultMigrator

Methods

clear

Clears out the legacy vault and removes it from the system. Be sure to run VaultMigrator.exportVault before calling this method.

Usage


_10
const data = await migrator.exportVault();
_10
await importVault(data);
_10
await migrator.clear();

Returns: Promise<void>

exportVault

Exports the data of the legacy vault in its entirety.

Usage


_10
const data = await migrator.exportVault();
_10
console.log("@@VAULT DATA: ", JSON.stringify(data));

Returns: Promise<any>