Skip to main content
Version: 5.0

VaultMigrator

Constructors#

constructor#

Usage#

const legacyVaultConfig = { unlockOnAccess: true, hideScreenOnBackground: true, lockAfter: 5000, // and more ....}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#

const data = await migrator.exportVault();await importDataToNewVault(data);await migrator.clear();

Returns: Promise<void>

exportVault#

Exports the data of the legacy vault in its entirety.

Usage#

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

Returns: Promise<any>