React Native Component SDK
Take direct control of individual Assentify identity components inside your React Native app: face capture, ID document capture, extraction, and signing. Capture on device, then submit the collected data to Assentify DXP for compliance, AML, and Client profile processing.
Install · Initialize · CaptureOverview
Assentify offers two kinds of SDK. This page documents the Component SDK for React Native.
Flow SDK
Embeds a whole published DXP flow, a complete guided journey, natively in your app. It is driven by a generated flow URL and runs the end to end experience for you. See the SDK overview for the Flow SDK.
Component SDK (this guide)
Gives developers direct control of individual identity components, for example face capture, ID document capture, and extraction, and lets you submit the collected data to Assentify DXP.
The Assentify Component SDK has several capabilities and functionalities that empower developers to take complete control of the Identity extraction process. The Component SDK complements the Assentify DXP platform (SaaS). The developer leverages the available data by using the response information from the supported components or data provided by the app user. The SDK allows the developer to submit all extracted data to Assentify to gain access to further features such as Compliance, AML, Client profile, and other features that the DXP covers.
Definitions
| Term | Meaning |
|---|---|
| Component SDK | The set of standalone, event driven identity components documented here. The developer controls each component and submits the collected data to Assentify DXP. |
| Assentify DXP | The Digital Experience Platform (DXP), the SaaS platform that the Component SDK complements. Configuration and processing live here. |
| BlockLoader | A core component that provides context to Assentify DXP and carries built-in and custom properties for the interaction. |
| Identification Document Capture | A standalone event driven component that extracts information from an ID card, passport, or other document. |
| Face Capture / Matching | A standalone event driven component that matches a live source image against a target image. |
| Templates | The document templates, grouped by country, that determine which fields are extracted for a given ID type. |
| Submission | The built-in function that transmits the collected data from your app to Assentify DXP. |
Requirements
To leverage the capabilities of the Assentify Component SDK, the developer must initialize the SDK on each application start up. You will need the following values, all of which are retrieved from the Assentify DXP portal.
| Value | Where to find it |
|---|---|
| API Key | Developers section. Create a new API Key or reuse an existing key. You can assign Claims to an API Key to limit the amount of access a specific key has. |
| Tenant Identifier | Developers → Flow Configuration. Select the flow and the Engagement block to view the flow information, which includes the Tenant Identifier. |
| Interaction Hash | Flow Manager. Select your flow and read the Digital Engagement Link on the right side panel, in the form https://platform.assentify.com?interaction={HASH}. Copy the HASH part. |
- Visit the Assentify DXP and click on the Developers section, then click the Flow Configuration button.
- Select the flow you want to use with your application, then from the drop-down menu select the Engagement block you would like to target.
- Once you have selected an appropriate block you will see the information related to the flow. Retrieve the Tenant Identifier from this section.
- To retrieve the API Key, create a new API Key or leverage an already existing key. Assign Claims to an API Key to limit the amount of access it has.
- To fetch the Interaction Hash, click on the Flow Manager and select your flow. Once the Digital Engagement Link has loaded, copy the HASH part of
https://platform.assentify.com?interaction={HASH}.
Installation
The Assentify Component SDK is available for React Native and runs against the Android and iOS native components. Retrieve your API Key, Tenant Identifier, and Interaction Hash from the Assentify DXP portal before you begin, as described under Requirements.
Native setup
Because the components use the device camera and native scanning, provide the platform capture permissions and honor the device capability settings that the SDK exposes at initialization.
| Consideration | Detail |
|---|---|
| Camera | The selfie camera captures the source image for Face Capture / Matching, and the rear camera captures ID documents. Grant the platform camera permission. |
| Android low memory fallback | minRam: any Android device with RAM smaller than this value uses manual scanning instead of automatic detection. |
| iOS low memory fallback | iOSMinRam: any iOS device with RAM smaller than this value uses manual scanning instead of automatic detection. |
| Motion frame limits | Per platform frame counts control when a steady hand triggers a send. See the initialization parameters below. |
Initialization
The assentifySdk object is an instance of AssentifySdk and is initialized with several parameters. Provide the API Key and Tenant Identifier retrieved from the DXP portal, along with the Interaction hash.
const assentifySdk = new AssentifySdk({
apiKey: "",
tenantIdentifier: "",
interaction: "",
activePerformLivenessFace: true,
customColor: "#",
enableDetect: true,
});
Core parameters
| Parameter | Description |
|---|---|
apiKey | Placeholder for the API Key, currently empty. |
tenantIdentifier | Placeholder for a tenant identifier, currently empty. |
interaction | Placeholder for interaction type or ID, currently empty. |
activePerformLivenessFace | Enable local active liveness check for face. |
customColor | Custom color setting with a hex code ("#"). |
enableDetect | Detection feature is enabled (true). |
Capture and detection tuning
| Parameter | Description |
|---|---|
androidMotionCardLimit | Number of frames taken before sending in case of steady hand, for ID Card Android. |
androidMotionPassportLimit | Number of frames taken before sending in case of steady hand, for Passport Android. |
iOSMotionCardsLimit | Number of frames taken before sending in case of steady hand, for ID Card and Passport iOS. |
iOSMotionFaceLimit | Number of frames taken before sending in case of steady hand, for Face iOS. |
androidBrightnessHighThreshold | Acceptable high brightness threshold, Android. |
androidBrightnessLowThreshold | Acceptable low brightness threshold, Android. |
iOSBrightnessHighThreshold | Acceptable high brightness threshold, iOS. |
iOSBrightnessLowThreshold | Acceptable low brightness threshold, iOS. |
Liveness and device fallback
| Parameter | Description |
|---|---|
activeLiveType | Local active liveness type: 1_actions (move your head left, right, up, down), 2_wink (wink your eye left or right), 3_blink. |
activeLivenessCheckCount | The number of times the local active liveness check will be requested. |
faceLivenessRetryCount | The number of times the user failed the face liveness before passing the step. |
minRam | Any Android device with RAM smaller than this value will use manual scanning instead of automatic detection. |
iOSMinRam | Any iOS device with RAM smaller than this value will use manual scanning instead of automatic detection. |
manualClickColor | Color setting for the manual scan page click ("#"). |
CountDownNumbersColor | Custom color setting with a hex code for the count down timer on the Face Match step (for example "#610A3A"). |
Initialization listener
Listen to assentifySdkInit to know when the SDK is ready.
| Field | Description |
|---|---|
status | True / False. |
templates | List<TemplatesByCountry>. Store the result to be used later on in the process when processing an ID Card. |
BlockLoader
The Assentify BlockLoader is a core component that performs several functions and gives context to the Assentify DXP platform. It provides these built-in properties that the developer sets.
Built-in properties
DeviceName · FlowName · TimeStarted · Application · UserAgent · InstanceHash
Custom properties
Access the DXP and add additional properties such as phoneNumber and clientIdentifier to transfer custom information to Assentify DXP, which can later be mapped to WebHooks or other platform capabilities. There is no limit on the number of properties you can add.
How to add a property to the BlockLoader
- Go to the Flow Manager and select the flow you want to edit.
- Click the view more button on the Engagement Block.
- In the input field, type the name of the property, then press the add button.
- Completed.
Identification Document Capture
The Identification Document Capture is a standalone event driven component that provides a means by which the developer can extract information from an ID Card. The ID type is determined by the configuration set in Assentify DXP. The developer or business user can log in to Assentify and manage these configurations anytime, even after the application has gone live, so the application supports as many ID cards as possible without re-compiling and deploying.
This component returns many different types of information depending on the ID type being scanned, such as a Civil ID versus a Driving License, using dynamic keys and mappings built into the SDK. A global model is available so developers can extract information from the base model and the available property dictionary. The component has a built-in user interface that can be used by default, or the developer can turn off the guides and default interface and use their own custom user interface, driven by the events fired during scanning.
startFlow
The startFlow function initializes and launches the entire flow, including the UI and events configured in the Admin Portal.
assentifySdk.startFlow({
logoUrl: "",
svgBackgroundImageUrl: "",
textColor: "#000000",
secondaryTextColor: "",
backgroundCardColor: "",
accentColor: "",
backgroundColor: "",
clickColor: "",
backgroundType: "",
language: "",
enableNfc: false,
enableQr: false,
blockLoaderCustomProperties: {},
clean: false,
});
| Parameter | Description |
|---|---|
logoUrl (optional) | URL of the logo displayed in the flow header or main screen. |
svgBackgroundImageUrl (optional) | URL of the SVG background image used for the screen background. |
textColor (optional) | Primary text color in HEX format (for example #000000). |
secondaryTextColor (optional) | Secondary text color in HEX format, used for subtitles or less prominent text. |
backgroundCardColor (optional) | Background color for cards and containers in HEX format. |
accentColor (optional) | Accent color used for highlights and interactive elements. |
backgroundColor (optional) | Defines the main background style of the screen. Can be Solid (single color) or Gradient (multiple colors with angle). |
clickColor (optional) | Defines the background style applied on click or pressed states. |
backgroundType | Defines how the background should be rendered (for example color or image). This is the only required field. |
language (optional) | Optionally set the language that the OCR will process the extracted content from the cards. |
enableNfc, enableQr | Triggers NFC scanning after scanning a passport, or QR scanning after scanning a card. |
blockLoaderCustomProperties | Map containing the custom properties configured in the Admin Portal. |
clean | Save flow progress or not. |
- Initialize the Assentify Sdk object.
- Call
AssentifySdk.startFlow(). - Configure the
startFlowparameters. - Listen to
OnFlowCompleted.
ID Card scanning
- Initialize the Assentify Sdk.
- Call
Assentify.startScanIDCard(). - Configure the
startScanIDCardparameters. - Pass the
templatesByCountryparameter, which includes all the available templates that are retrieved. - Listen to
onCompleteIDCard.
Passport scanning
- Initialize the Assentify object.
- Call
Assentify.startScanPassport(). - Configure the
startScanPassportparameters. - Listen to
onCompletePassport.
Other ID scanning
- Initialize the Assentify object.
- Call
Assentify.startScanOther(). - Configure the
startScanOtherparameters. - Listen to
onCompleteOther.
Face Capture / Matching
The Face Capture and Matching step is a standalone event driven component that allows the developer to perform face matching between a live source and a target image. The developer offers the target image, while the selfie camera captures the source image. All the features and capabilities of the component are driven by the configuration that the developer or business user can configure on Assentify DXP. The developer may choose to override this configuration.
- Initialize the Assentify object.
- Call
Assentify.startFaceMatch(). - Configure the
startFaceMatchparameters. - Supply the target url face image.
- Supply the target show count down parameter,
true/false. - Listen to
onCompleteFaceMatch.
Context Aware Signing
Use Context Aware Signing to collect the tokens from a selected document, create a user document instance, apply a signature, and retrieve the signed document URL.
- Initialize the Assentify object.
- Call
Assentify.startContextAwareSigning(). - Wait for
signingOnHasTokens: the tokens from your selected document. - Fill the tokens and call
createUserDocumentInstance. - Wait for
signingOnCreateUserDocumentInstance: call the signature function with the base64 signature. - Wait for
signingOnSignature: get the document URL.
Submission
Submission is a built-in function of the SDK that allows the developer to initiate the data transmission from the integrating app to Assentify DXP. The power of Submission is that it can be used to add additional properties to the BlockLoader.
Listen to SubmitDataEvents to follow the submission.
onComplete callback is triggered, the application receives all the information. It is the responsibility of the application to transfer that data to any specific backend at that point. If data can be transferred after submission to the platform, you can define a webhook in the connector block to be triggered after submission to inform your backend or send you specific data.Events & results
Components are event driven. Each capture surfaces a BaseResponseDataModel result together with lifecycle events.
| Event | Description |
|---|---|
onSend() | Starts processing. |
onRetry() | Invoked when processing fails. |
onWrongTemplate() | ID Card. Called when trying to scan a wrong ID base in the submitted template. |
Component completion events
| Component | Completion event |
|---|---|
| Flow | OnFlowCompleted |
| ID Card scanning | onCompleteIDCard |
| Passport scanning | onCompletePassport |
| Other ID scanning | onCompleteOther |
| Face Capture / Matching | onCompleteFaceMatch |
| Submission | SubmitDataEvents |
| Context Aware Signing | signingOnHasTokens, signingOnCreateUserDocumentInstance, signingOnSignature |
Data models
BaseResponseDataModel
| Field | Description |
|---|---|
outputProperties | A map containing the extracted data with hash keys for submission. |
transformedProperties | A map with extracted data that may be transformed if translation is needed. |
additionalDetails | Extra extracted data, particularly for "Other Scanning." |
imageUrl | The URL of the ID image. |
faces | URLs of faces extracted from the ID. |
identificationDocumentCapture | This model contains all extracted data. |
baseImageFace | The selfie image used for "Face Match." |
secondImageFace | The image provided for comparison in "Face Match." |
percentageMatch | Match percentage. |
isLive | Liveliness detection result. |
TemplatesByCountry
| Field | Type | Description |
|---|---|---|
name | String | The name of the country. |
sourceCountryCode | String | The ISO-2 country code. |
flag | String | The country flag image. |
templates | List<Templates> | The list of templates by country. |
KycDocumentDetails
| Field | Type | Description |
|---|---|---|
name | String | The name of the document. |
order | Int | The order of the page (front, back, etc.). |
templateSpecimen | String | The default specimen that represents the ID type being used (Civil ID, Driving License, etc.). |
templateProcessingKeyInformation | String | The template Id. |
Templates
| Field | Type | Description |
|---|---|---|
id | Int | The template Id. |
sourceCountryFlag | String | The flag of the country as a URL. |
sourceCountryCode | String | The ISO-2 country code. |
kycDocumentType | String | The name of the Template. |
sourceCountry | String | The country name. |
kycDocumentDetails | List<KycDocumentDetails> | A list of KycDocumentDetails. |
IDExtractedModel
| Field | Type | Description |
|---|---|---|
outputProperties | Map<String, Any>? | Output properties map. |
transformedProperties | Map<String, String>? | Transformed properties map. |
extractedData | Map<String, Any>? | Extracted data map. |
imageUrl | String? | URL for the image. |
faces | List<String>? | List of detected faces. |
identificationDocumentCapture | IdentificationDocumentCapture? | Identification document capture details. |
PassportExtractedModel
| Field | Type | Description |
|---|---|---|
outputProperties | Map<String, Any>? | Output properties map. |
transformedProperties | Map<String, String>? | Transformed properties map. |
extractedData | Map<String, Any>? | Extracted data map. |
imageUrl | String? | URL for the image. |
faces | List<String>? | List of detected faces. |
identificationDocumentCapture | IdentificationDocumentCapture? | Identification document capture details. |
OtherExtractedModel
| Field | Type | Description |
|---|---|---|
outputProperties | Map<String, Any>? | Output properties map. |
transformedProperties | Map<String, String>? | Transformed properties map. |
extractedData | Map<String, Any>? | Extracted data map. |
additionalDetails | Map<String, Any>? | Additional details map. |
transformedDetails | Map<String, String>? | Transformed details map. |
imageUrl | String? | URL for the image. |
faces | List<String>? | List of detected faces. |
identificationDocumentCapture | IdentificationDocumentCapture? | Identification document capture details. |
FaceExtractedModel
| Field | Type | Description |
|---|---|---|
outputProperties | Map<String, Any>? | Output properties map. |
extractedData | Map<String, Any>? | Extracted data map. |
baseImageFace | String? | Base image face. |
secondImageFace | String? | Second image face. |
percentageMatch | Int? | Percentage match between faces. |
isLive | Boolean? | Whether the face is live. |
identificationDocumentCapture | IdentificationDocumentCapture? | Identification document capture details. |
IdentificationDocumentCapture
This model contains all extracted data. Every field is of type Any?.
| Field | Description |
|---|---|
name | Name of the document holder. |
surname | Surname of the document holder. |
documentType | Type of the document. |
birthDate | Birthdate of the document holder. |
documentNumber | Document number. |
sex | Sex of the document holder. |
expiryDate | Expiry date of the document. |
country | Country of the document. |
nationality | Nationality of the document holder. |
idType | ID type of the document. |
faceCapture | Face capture details. |
image | Image of the document. |
isSkippedAfterMRZFails | Whether MRZ failed after skipping. |
isFailedFront | Whether the front check failed. |
isFailedBack | Whether the back check failed. |
skippedStatus | Skipped status. |
capturedVideoFront | Captured video of the front. |
capturedVideoBack | Captured video of the back. |
livenessStatus | Liveness status of the document holder. |
isFrontAuth | Whether the front is authorized. |
isBackAuth | Whether the back is authorized. |
isExpired | The document isExpired (true, false). |
isTampering | The document is tampered (true, false). |
tamperHeatMap | The URL to the tampering heatmap. |
isBackTampering | The back of the document has been tampered. |
backTamperHeatmap | The URL to the heatmap of the back-side of the document. |
originalBackImage | The URL to the back-side of the image. |
ghostImage | The URL to the ghost image. |
idMaritalStatus | The marital status. |
idDateOfIssuance | The date of issuance. |
idCivilRegisterNumber | The civil register number. |
idPlaceOfResidence | The place of residence. |
idProvince | The province. |
idGovernorate | The governorate. |
idMothersName | The mothers name. |
idFathersName | The fathers name. |
idPlaceOfBirth | The place of birth. |
idBackImage | The URL to the back image. |
idBloodType | The blood type. |
idDrivingCategory | The driving category. |
idIssuanceAuthority | The issuance authority that issued the ID. |
idArmyStatus | The army status. |
idProfession | The profession of the id holder. |
idUniqueNumber | The unique number on the id card. |
idDocumentTypeNumber | The ID document number. |
idFees | The fees paid. |
idReference | The reference data associated with the id card. |
idRegion | The region. |
idRegistrationLocation | The registration location. |
idFaceColor | The face color. |
idEyeColor | The eye color. |
idSpecialMarks | Any special marks (tattoos, etc.). |
idCountryOfStay | The current country of stay. |
idIdentityNumber | The Identity Number of the ID. |
idPresentAddresss | The card holder present address. |
idPermanentAddresss | The card holder permanent address. |
idFamilyNumber | The family name. |
identityNumberBack | The identity number found on the back of the id card. |
DocumentTokensModel
| Field | Type | Description |
|---|---|---|
displayName | String | Token name. |
id | int | Token id. |
templateId | int | Document id. |
tokenTypeEnum | int? | Token type. |
CreateUserDocumentResponseModel
| Field | Type | Description |
|---|---|---|
documentId | int | Document id. |
isPdf | bool | Is Html or Pdf. |
templateInstance | String | Document as base64 after filling the tokens. |
templateInstanceId | int? | The new Document id. |
SignatureResponseModel
| Field | Type | Description |
|---|---|---|
fileName | String | Document name. |
signedDocument | bool | Document as base64 after signed. |
signedDocumentUri | String | Document as URL after signed. |
FAQ
Can you set what data the ResponseModels have from the admin page?
No, the response models are static and are based on responses from our core ID orchestrator.
When the onComplete callback is triggered (for example for the passport), can that data be retrieved or a hook triggered on our backend?
When the callback is triggered, the application receives all the information. It is the responsibility of the application to transfer that data to any specific backend at this point. If the data can be transferred at a later stage, or when it has been submitted to our platform, then yes, you can define a webhook in the connector block to be triggered after submission to inform your backend or send you specific data.
What are the KycDocumentDetails on the ScanIDCard? How would I know how many to add to the list?
The template chosen from the Templates object.