Capacitor plugin exposing the Veriff SDK - Smart and scalable identity verification
Add the maven repository to the android/build.gradle
application file:
allprojects {
repositories {
// make sure to add this before other repos
maven { url "https://cdn.veriff.me/android/" } // <------------ ADD THIS LINE
google()
...
}
}
add the required permissions in your Info.plist file
<key>NSCameraUsageDescription</key>
<string>Veriff plugin needs camera permissions</string>
<key>NSMicrophoneUsageDescription</key>
<string>Veriff plugin needs microphone permissions</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Veriff plugin needs poto library access permissions</string>
<key>NFCReaderUsageDescription</key>
<string>Veriff plugin needs NFC permissions</string>
npm install capacitor-plugin-veriff
npx cap sync
The plugin exposes the VERIFF JavaScript namespace which cointains a Veriff end-to-end verification service.
To use this plugin:
In your ionic app:
- Import the
VeriffPlugin
in your ionic app
import { VeriffPlugin } from 'capacitor-plugin-veriff';
-
Create a session verification with your Veriff API KEY.
-
Start the verification process:
We will need the verification sessionUrl to start the Veriff process
const sessionUrl = session.verification.url;
const configuration = {
themeColor: '#0F3C32'
};
const options = {sessionUrl, configuration};
try {
const result = await VeriffPlugin.start(options);
// The promise returns the VeriffSDK verification result
console.log("Result: ", result);
} catch(error) {
console.error('Error starting Veriff ', error)
}
Within root plugin path:
$ npm run build
start(params: { sessionUrl: string; configuration: { themeColor: string; }; }) => Promise<{ message: string; status: string; }>
Param | Type |
---|---|
params |
{ sessionUrl: string; configuration: { themeColor: string; }; } |
Returns: Promise<{ message: string; status: string; }>