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.
Initialize your SDK in your activity or fragment as follows
docKitBuilder = VIDVDocKitConfig.Builder()
docKitBuilder=new VIDVDocKitConfig.Builder();
Configurations
The SDK builder is separated into two components.
Make sure that you fetched the access token successfully before passing it to the Builder object.
Required Configurations
docKitBuilder .setBaseUrl("Base Url") // add your actual base url .setAccessToken("Access Token") // add the fetched access token here .setBundleKey("Bundle Key") // add your actual bundle key .setDocumentType(VIDVDocKitDocType.<your chosen doc type>()) //avaliable doc types: passport - egyNID - tunNID -dzaNID
docKitBuilder.setBaseUrl("Base Url");//add your actual base url.setAccessToken("Access Token");//add the fetched access token here.setBundleKey("Bundle Key");//add your actual bundle key.setDocumentType(VIDVDocKitDocType.passport());//avaliable doc types: passport - egyNID - tunNID - dzaNID
Optional Configurations
Configurations Breakdown
1. Sets the base URL used by the SDK to communicate with your backend APIs.
2. Sets the access token required for authenticating SDK API requests.
3. Associates the session with your account using a unique bundle key.
4. Specifies the type of document to be captured by the SDK.
Available options:
passport()
egyNID()
tunNID()
dzaNID()
5. Sets the interface language used throughout the SDK experience.
Supported languages:
"en" for English
"ar" for Arabic
"fr" for French
6. Enables the collection of user info like location. Requires location permission in manifest.
7. Enables image preview after capture so users can confirm or retake it.
8. Displays a data review screen before submitting the final result.
9. Enables manual capture mode for users instead of automatic capture.
10. Sets your brand’s primary color in the SDK UI. Use a hex color string.
11. Displays your logo in the SDK UI using a drawable resource from your app.
12. Displays your logo using a byte array (e.g., from a file or server).
13. Hides Valify's logo entirely from the SDK UI.
Adds optional feature flags that enhance the SDK's processing capabilities.
These extras allow you to enable advanced functionalities during EGY NID document processing:
docKitBuilder
.setLanguage("en") // or "ar"
.setCollectUserInfo(true) // enable location permissions if true
.previewCapturedImage(true) // show preview of captured image
.reviewData(true) // show a review screen before finishing
.setCaptureMode(VIDVCaptureMode.<your_chosen_capture_mode>.INSTANCE) //Choose from MANUAL , AUTOMATIC, AUTO_AFTER(7)
.setExtras(
mapOf(
"advancedConfidence" to true,
"professionAnalysis" to true,
"documentVerificationPlus" to true
)
) // only valid for Egy NID docuemnt
// UI Customization
.setPrimaryColor("#FFA500".toColorInt())
.setLogo(VIDVLogo.ResourceLogo(R.drawable.logo))
//or
.setLogo(VIDVLogo.ByteArrayLogo(byteArray))
//or
.setLogo(VIDVLogo.Empty()) // Hide logo
docKitBuilder
.setLanguage("en"); // or "ar"
.setCollectUserInfo(true);
.previewCapturedImage(true); // show preview of captured image
.reviewData(true); // show a review screen before finishing
.setCaptureMode(VIDVCaptureMode.<your_chosen_capture_mode>.INSTANCE); //Choose from MANUAL , AUTOMATIC, AUTO_AFTER(7)
.setExtras(extras); // attach the extras map
// UI Customization
.setPrimaryColor(android.graphics.Color.parseColor("#FFA500"));
.setLogo(new VIDVLogo.ResourceLogo(R.drawable.logo));
// OR:
.setLogo(new VIDVLogo.ByteArrayLogo(byteArray));
// OR:
.setLogo(new VIDVLogo.Empty()); // hide logo
.setBaseUrl("Base Url")
.setAccessToken("Access Token") // add the fetched access token here
.setBundleKey("Bundle Key") // add your actual bundle key
.setDocumentType(VIDVDocKitDocType.passport())
.setLanguage("en")
.setCollectUserInfo(true)
.previewCapturedImage(true)
.reviewData(true)
.setCaptureMode(VIDVCaptureMode.MANUAL.INSTANCE) //Allows manual capture fromthe beginning
.setCaptureMode(VIDVCaptureMode.AUTOMATIC.INSTANCE) //Allows Automatic capture from the beginning
.setCaptureMode(VIDVCaptureMode.AUTO_AFTER(<yourChosenTimeInSec>)) //Allows manual capture the configured time if the image wasn't auto-captured