Developers · React Native Component SDK Developer
SDK

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 · Capture
Platform React Native Targets Android & iOS native Type Component SDK Requires API Key · Tenant Identifier · Interaction Hash

Overview

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.

Where this SDK runsThe Assentify Component SDK is available for Android native, iOS native, Flutter, and React Native. This page covers the React Native integration.

Definitions

TermMeaning
Component SDKThe set of standalone, event driven identity components documented here. The developer controls each component and submits the collected data to Assentify DXP.
Assentify DXPThe Digital Experience Platform (DXP), the SaaS platform that the Component SDK complements. Configuration and processing live here.
BlockLoaderA core component that provides context to Assentify DXP and carries built-in and custom properties for the interaction.
Identification Document CaptureA standalone event driven component that extracts information from an ID card, passport, or other document.
Face Capture / MatchingA standalone event driven component that matches a live source image against a target image.
TemplatesThe document templates, grouped by country, that determine which fields are extracted for a given ID type.
SubmissionThe 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.

ValueWhere to find it
API KeyDevelopers 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 IdentifierDevelopers → Flow Configuration. Select the flow and the Engagement block to view the flow information, which includes the Tenant Identifier.
Interaction HashFlow 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.
  1. Visit the Assentify DXP and click on the Developers section, then click the Flow Configuration button.
  2. 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.
  3. Once you have selected an appropriate block you will see the information related to the flow. Retrieve the Tenant Identifier from this section.
  4. 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.
  5. 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.

Package name and versionThe source documentation does not specify a package registry name or version for the React Native Component SDK. Follow the distribution instructions provided with your Assentify DXP account, then continue with Native setup and Initialization below.

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.

ConsiderationDetail
CameraThe 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 fallbackminRam: any Android device with RAM smaller than this value uses manual scanning instead of automatic detection.
iOS low memory fallbackiOSMinRam: any iOS device with RAM smaller than this value uses manual scanning instead of automatic detection.
Motion frame limitsPer 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

ParameterDescription
apiKeyPlaceholder for the API Key, currently empty.
tenantIdentifierPlaceholder for a tenant identifier, currently empty.
interactionPlaceholder for interaction type or ID, currently empty.
activePerformLivenessFaceEnable local active liveness check for face.
customColorCustom color setting with a hex code ("#").
enableDetectDetection feature is enabled (true).

Capture and detection tuning

ParameterDescription
androidMotionCardLimitNumber of frames taken before sending in case of steady hand, for ID Card Android.
androidMotionPassportLimitNumber of frames taken before sending in case of steady hand, for Passport Android.
iOSMotionCardsLimitNumber of frames taken before sending in case of steady hand, for ID Card and Passport iOS.
iOSMotionFaceLimitNumber of frames taken before sending in case of steady hand, for Face iOS.
androidBrightnessHighThresholdAcceptable high brightness threshold, Android.
androidBrightnessLowThresholdAcceptable low brightness threshold, Android.
iOSBrightnessHighThresholdAcceptable high brightness threshold, iOS.
iOSBrightnessLowThresholdAcceptable low brightness threshold, iOS.

Liveness and device fallback

ParameterDescription
activeLiveTypeLocal active liveness type: 1_actions (move your head left, right, up, down), 2_wink (wink your eye left or right), 3_blink.
activeLivenessCheckCountThe number of times the local active liveness check will be requested.
faceLivenessRetryCountThe number of times the user failed the face liveness before passing the step.
minRamAny Android device with RAM smaller than this value will use manual scanning instead of automatic detection.
iOSMinRamAny iOS device with RAM smaller than this value will use manual scanning instead of automatic detection.
manualClickColorColor setting for the manual scan page click ("#").
CountDownNumbersColorCustom 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.

FieldDescription
statusTrue / False.
templatesList<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

  1. Go to the Flow Manager and select the flow you want to edit.
  2. Click the view more button on the Engagement Block.
  3. In the input field, type the name of the property, then press the add button.
  4. 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,
});
ParameterDescription
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.
backgroundTypeDefines 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, enableQrTriggers NFC scanning after scanning a passport, or QR scanning after scanning a card.
blockLoaderCustomPropertiesMap containing the custom properties configured in the Admin Portal.
cleanSave flow progress or not.
  1. Initialize the Assentify Sdk object.
  2. Call AssentifySdk.startFlow().
  3. Configure the startFlow parameters.
  4. Listen to OnFlowCompleted.

ID Card scanning

  1. Initialize the Assentify Sdk.
  2. Call Assentify.startScanIDCard().
  3. Configure the startScanIDCard parameters.
  4. Pass the templatesByCountry parameter, which includes all the available templates that are retrieved.
  5. Listen to onCompleteIDCard.

Passport scanning

  1. Initialize the Assentify object.
  2. Call Assentify.startScanPassport().
  3. Configure the startScanPassport parameters.
  4. Listen to onCompletePassport.

Other ID scanning

  1. Initialize the Assentify object.
  2. Call Assentify.startScanOther().
  3. Configure the startScanOther parameters.
  4. 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.

  1. Initialize the Assentify object.
  2. Call Assentify.startFaceMatch().
  3. Configure the startFaceMatch parameters.
  4. Supply the target url face image.
  5. Supply the target show count down parameter, true / false.
  6. 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.

  1. Initialize the Assentify object.
  2. Call Assentify.startContextAwareSigning().
  3. Wait for signingOnHasTokens: the tokens from your selected document.
  4. Fill the tokens and call createUserDocumentInstance.
  5. Wait for signingOnCreateUserDocumentInstance: call the signature function with the base64 signature.
  6. 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.

After the callback firesWhen an 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.

EventDescription
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

ComponentCompletion event
FlowOnFlowCompleted
ID Card scanningonCompleteIDCard
Passport scanningonCompletePassport
Other ID scanningonCompleteOther
Face Capture / MatchingonCompleteFaceMatch
SubmissionSubmitDataEvents
Context Aware SigningsigningOnHasTokens, signingOnCreateUserDocumentInstance, signingOnSignature

Data models

BaseResponseDataModel

FieldDescription
outputPropertiesA map containing the extracted data with hash keys for submission.
transformedPropertiesA map with extracted data that may be transformed if translation is needed.
additionalDetailsExtra extracted data, particularly for "Other Scanning."
imageUrlThe URL of the ID image.
facesURLs of faces extracted from the ID.
identificationDocumentCaptureThis model contains all extracted data.
baseImageFaceThe selfie image used for "Face Match."
secondImageFaceThe image provided for comparison in "Face Match."
percentageMatchMatch percentage.
isLiveLiveliness detection result.

TemplatesByCountry

FieldTypeDescription
nameStringThe name of the country.
sourceCountryCodeStringThe ISO-2 country code.
flagStringThe country flag image.
templatesList<Templates>The list of templates by country.

KycDocumentDetails

FieldTypeDescription
nameStringThe name of the document.
orderIntThe order of the page (front, back, etc.).
templateSpecimenStringThe default specimen that represents the ID type being used (Civil ID, Driving License, etc.).
templateProcessingKeyInformationStringThe template Id.

Templates

FieldTypeDescription
idIntThe template Id.
sourceCountryFlagStringThe flag of the country as a URL.
sourceCountryCodeStringThe ISO-2 country code.
kycDocumentTypeStringThe name of the Template.
sourceCountryStringThe country name.
kycDocumentDetailsList<KycDocumentDetails>A list of KycDocumentDetails.

IDExtractedModel

FieldTypeDescription
outputPropertiesMap<String, Any>?Output properties map.
transformedPropertiesMap<String, String>?Transformed properties map.
extractedDataMap<String, Any>?Extracted data map.
imageUrlString?URL for the image.
facesList<String>?List of detected faces.
identificationDocumentCaptureIdentificationDocumentCapture?Identification document capture details.

PassportExtractedModel

FieldTypeDescription
outputPropertiesMap<String, Any>?Output properties map.
transformedPropertiesMap<String, String>?Transformed properties map.
extractedDataMap<String, Any>?Extracted data map.
imageUrlString?URL for the image.
facesList<String>?List of detected faces.
identificationDocumentCaptureIdentificationDocumentCapture?Identification document capture details.

OtherExtractedModel

FieldTypeDescription
outputPropertiesMap<String, Any>?Output properties map.
transformedPropertiesMap<String, String>?Transformed properties map.
extractedDataMap<String, Any>?Extracted data map.
additionalDetailsMap<String, Any>?Additional details map.
transformedDetailsMap<String, String>?Transformed details map.
imageUrlString?URL for the image.
facesList<String>?List of detected faces.
identificationDocumentCaptureIdentificationDocumentCapture?Identification document capture details.

FaceExtractedModel

FieldTypeDescription
outputPropertiesMap<String, Any>?Output properties map.
extractedDataMap<String, Any>?Extracted data map.
baseImageFaceString?Base image face.
secondImageFaceString?Second image face.
percentageMatchInt?Percentage match between faces.
isLiveBoolean?Whether the face is live.
identificationDocumentCaptureIdentificationDocumentCapture?Identification document capture details.

IdentificationDocumentCapture

This model contains all extracted data. Every field is of type Any?.

FieldDescription
nameName of the document holder.
surnameSurname of the document holder.
documentTypeType of the document.
birthDateBirthdate of the document holder.
documentNumberDocument number.
sexSex of the document holder.
expiryDateExpiry date of the document.
countryCountry of the document.
nationalityNationality of the document holder.
idTypeID type of the document.
faceCaptureFace capture details.
imageImage of the document.
isSkippedAfterMRZFailsWhether MRZ failed after skipping.
isFailedFrontWhether the front check failed.
isFailedBackWhether the back check failed.
skippedStatusSkipped status.
capturedVideoFrontCaptured video of the front.
capturedVideoBackCaptured video of the back.
livenessStatusLiveness status of the document holder.
isFrontAuthWhether the front is authorized.
isBackAuthWhether the back is authorized.
isExpiredThe document isExpired (true, false).
isTamperingThe document is tampered (true, false).
tamperHeatMapThe URL to the tampering heatmap.
isBackTamperingThe back of the document has been tampered.
backTamperHeatmapThe URL to the heatmap of the back-side of the document.
originalBackImageThe URL to the back-side of the image.
ghostImageThe URL to the ghost image.
idMaritalStatusThe marital status.
idDateOfIssuanceThe date of issuance.
idCivilRegisterNumberThe civil register number.
idPlaceOfResidenceThe place of residence.
idProvinceThe province.
idGovernorateThe governorate.
idMothersNameThe mothers name.
idFathersNameThe fathers name.
idPlaceOfBirthThe place of birth.
idBackImageThe URL to the back image.
idBloodTypeThe blood type.
idDrivingCategoryThe driving category.
idIssuanceAuthorityThe issuance authority that issued the ID.
idArmyStatusThe army status.
idProfessionThe profession of the id holder.
idUniqueNumberThe unique number on the id card.
idDocumentTypeNumberThe ID document number.
idFeesThe fees paid.
idReferenceThe reference data associated with the id card.
idRegionThe region.
idRegistrationLocationThe registration location.
idFaceColorThe face color.
idEyeColorThe eye color.
idSpecialMarksAny special marks (tattoos, etc.).
idCountryOfStayThe current country of stay.
idIdentityNumberThe Identity Number of the ID.
idPresentAddresssThe card holder present address.
idPermanentAddresssThe card holder permanent address.
idFamilyNumberThe family name.
identityNumberBackThe identity number found on the back of the id card.

DocumentTokensModel

FieldTypeDescription
displayNameStringToken name.
idintToken id.
templateIdintDocument id.
tokenTypeEnumint?Token type.

CreateUserDocumentResponseModel

FieldTypeDescription
documentIdintDocument id.
isPdfboolIs Html or Pdf.
templateInstanceStringDocument as base64 after filling the tokens.
templateInstanceIdint?The new Document id.

SignatureResponseModel

FieldTypeDescription
fileNameStringDocument name.
signedDocumentboolDocument as base64 after signed.
signedDocumentUriStringDocument 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.