Installation
Don't have an Identity Vault subscription? Try it free now.
Follow these steps to install Identity Vault into your app.'
Identity Vault Mimimum Requirements
Your project must have the following to use Identity Vault.
- Version
>= 3.5
oftypescript
Installation
If you have not already setup Ionic Enterprise in your app, follow the one-time setup steps.
Next, install the plugin:
- Capacitor
- Cordova
npm install @ionic-enterprise/identity-vault
npx cap sync
ionic cordova plugin add @ionic-enterprise/identity-vault
Capacitor Requirements
Update the info.plist
file of the ios project to include the required Face ID Usage Description:
_10<key>NSFaceIDUsageDescription</key>_10<string>Use Face ID to authenticate yourself and login</string>
Android SDK 30+. This is configured in the build.gradle
file for Capacitor. Capacitor 2 and above is supported. If using Capacitor 3, ensure Capacitor dependencies are >=3.0.2.
Cordova Requirements
cordova-android
version 10 or later is required (which supports Android SDK 30 and above).
Swift 4.2 is in the minimum required version and can be specified by opening config.xml
and below <platform name="ios">
specifying:
_10 <preference name="UseSwiftLanguageVersion" value="5" />
A suitable description is required to be displayed when Face ID is used for the first time. This can be specified by opening config.xml
and below <platform name="ios">
adding the following line:
_10<config-file parent="NSFaceIDUsageDescription" platform="ios" target="*-Info.plist">_10 <string>Face ID is used to securely sign in.</string>_10</config-file>
Configuring the Vault
Identity Vault is created in your application by instantiating a new instance of the Vault
class and passing a configuration object to the initialize
method.
_10const vault = new Vault();_10await vault.initialize({_10 key: 'io.ionic.identityvaultdemo',_10});
Once the vault is created, you can call the various methods on it including lock
and unlock
to secure the vault and setValue
and getValue
to manage data in the vault.
_10await vault.unlock();_10await vault.getValue('myKey');_10await vault.setValue('myKey', 'newValue!');_10await vault.lock();