Implementation Guide
Authentication
A unique access token should be created upon each SDK entry. In order to generate an access token, please refer to Valify's Authentication Documentation.
Security Warning: For improved security, consider implementing the access token fetching logic outside the Activity. This helps keep sensitive credentials secure and reduces potential exposure within the Activity/Fragment code.
Importing
Import the module’s function in your file using the following line
import 'package:vidvocr_flutter_plugin/vidvocr_flutter_plugin.dart';Configurations
The plugin builder is separated into two components.
Required Configurations
Initialize the required parameters as follows while adding the required configurations
final String baseURL = ' '; //put your acctual base url here
final String bundleKey = ' '; //put your actual bundle key here
final String accessToken = ' '; //put your actual access token here
Optional Configurations
Initialize the required parameters as follows while adding the desired configurations
final String language = "<insert_language>"; // "en" is set as default
final bool document_verification = <boolean>; // false is set as default
final bool collect_user_info = <boolean>; // false is set as default
final bool document_verification_plus = <boolean>; // false is set as default
final bool advanced_confidence = <boolean>; // false is set as default
final bool profession_analysis = <boolean>; // false is set as default
final bool review_data = <boolean>; // default is true
final bool preview_captured_image = <boolean>; //default is false
final bool manual_capture_mode = <boolean>; //default is false
final bool capture_only_mode = <boolean>; // default is false
final String primary_color = ”<hex_color_code>”; //default is valify default color
final bool disable_valify_logo = <boolean>; //default is false
final String custom_logo = "<base_64_image>";
final bool enable_logging= <boolean>; // default false
final HashMap<String, String> headers = HashMap();//default emptyConfigurations Breakdown
This section shows the breakdown of all optional builder configurations.
The following line is where the user interface language is set.
final String language = "<insert_language>"; // ["ar" or "en"] If the following line is set to true, the SDK will return document verification plus data
final bool document_verification_plus = <boolean>;If the following line is set to true, the SDK will return advanced confidence data
final bool advanced_confidence = <boolean>;If the following line is set to true, the captured image will be displayed for the user.
final bool preview_captured_image = <boolean>;If the following line is set to true, the SDK will automatically enable manual capture if it detects that the user is unable to autocapture card.
final bool manual_capture_mode = <boolean>;If the following line is set to true, a screen is added to the user flow that displays the images captured and the OCR result to the user.
final bool review_data = <boolean>;If the following line is set to true, the SDK purely performs image capturing and only returns these images in the SDK response.
final bool capture_only_mode = <boolean>;The following line is optional and can be used to receive event logs from the SDK experience to be used for user behavior analysis.
final bool enable_logging= <boolean>;The following line is optional and can be used to set your company's branding color to the SDK's user interface.
final String primaryColor = ”<hex_color_code>”;If the following line is set to
true, the Valify logo will be hidden from the SDK user interface.
final bool disable_valify_logo = <boolean>;The following line can be used to display a custom logo instead of the default Valify logo. The value should be a base64-encoded image string.
final String custom_logo = "<base_64_image>";The following line is optional and can be used to set any headers that may be required for purposes specific to your application. Any headers set will be sent along with each API call made by the SDK.
final HashMap<String, String> headers = HashMap();Parameter Declaration
Declare the SDK parameters with the configuration variables previously created
Map<String, dynamic> params = {
"base_url": baseURL,
"access_token": accessToken,
"bundle_key": bundleKey,
"language": language,
"document_verification": document_verification,
"review_data": review_data,
"capture_only_mode": capture_only_mode,
"manual_capture_mode": manual_capture_mode,
"preview_captured_image": preview_captured_image,
"primary_color": primary_color,
"disable_valify_logo": disable_valify_logo,
"custom_logo": custom_logo,
"enable_logging": enable_logging,
"collect_user_info": collect_user_info,
"advanced_confidence": advanced_confidence,
"profession_analysis": profession_analysis,
"document_verification_plus": document_verification_plus,
"headers": headers
};Start the SDK
Use the following code snippet to run the plugin
try {
final String? result = await VidvocrFlutterPlugin.startOCR(params);
//handle logic to use the liveness response depending on the state
} on PlatformException catch (e) {
//catch errors here
}Sample Integration Example
Check out our GitHub repository for a simple integration app demonstrating how to use our SDK. The repository includes step-by-step instructions and sample code to help you get started quickly.
Last updated