Skip to content

Document Reader SDK Architecture

Welcome to our in-depth exploration of the Document Reader SDK architecture. Whether you're working on a mobile, web, or desktop application, understanding the inner workings of our SDK will empower you to harness its capabilities to the fullest.

Mobile SDK

The API framework provides the external interface for controlling the process and getting the result. It depends on the Common framework that is an interface for working with the camera and other modules that are used in other Regula SDKs.

The Core framework provides the recognition functionality where all the processing happens. This is the internal framework, it is used by the API framework only and is not accessible for developers. However, it should be referenced in the project.

Resources contain the documents' data. They are mandatory to have if you use the Core type that supports document type recognition.

All processing is performed completely offline, no data leaves your mobile device. There is no need to have the Web Service running.

We provide solutions for both Native and Hybrid apps:

As NFC is required to perform RFID chip processing, it's available only on mobile devices using the Document Reader SDK for Mobile. Browsers don't support it yet.

Web Components

Web Components let you add document verification to your website. Web Components capture a document from the device camera or process an uploaded image, crop the image by the document boundaries, recognize the Machine Readable Zone (MRZ) and barcodes.

The Web Components package contains UI Web Components and Document Reader SDK.

UI Web Components are intended to recognize identity documents with built-in user interface;

Document Reader SDK is intended to recognize identity documents and allows creating your own user interface.

During document processing, these components interract with the Document Reader Service, which in turn communicates with WebAssembly (WASM).

WebAssembly (WASM) provides the recognition functionality where all the processing happens.

As Web Components don't support Document Type and Visual Zone recognition, once the processing is completed, you can send an image taken by Web Components to Web Service for further processing.

Web Service

Document Reader Web Service

The Web Service operates via an HTTP/S protocol. It receives a request and invokes the Core library that processes this request. When the Core library returns the results, they are sent back by the Web Service.

The Document Reader Web Service is distributed as:

To use the Web Service, you need to send an image and processing parameters via API. Here is the OpenAPI specification.

To simplify the integration and further maintenance, we supply API clients for popular programming languages. There are four API clients:

  • JavaScript client for the browser and node.js based on axios
  • Java client compatible with jvm and Android
  • Python 3.5+ client
  • C# client for .NET & .NET Core

There is a possibility to collect data to the storage after the processing ends.

Document Reader Web Service with Storage

How to connect Storage

A database is used to collect the transaction information, public and private keys. It is required to be configured in case of the Server-Side Verification.

Document Reader Web Service with Storage and Database

How to connect Database

Complete Server-Side Verification

Complete Server-Side Verification is an additional layer of protection against fraud. While it's true that all authenticity checks can be successfully completed on smartphones and edge devices, Regula Mobile SDK or Regula Web Components might not suffice. There's a potential risk of verification results being intercepted and modified by fraudsters directly on the same device.

In the "zero trust to mobile" approach, we introduce Complete Server-Side Verification. Documents' data, devices' metadata, transaction information are also saved in the Storage and Database after the processing is completed. During the RFID chip reading (optional), Regula Web Service becomes engaged in generating session keys and challenges, which are subsequently saved to Storage and Database. During the reprocessing, Regula Web Service fetches data from the Storage and Database. Once reprocessing is completed, you can then determine whether you should trust Regula Mobile SDK or Regula Web Components results or not.

  • With RFID chip processing

Complete Server-Side Verification (with RFID chip processing)

  • Without RFID chip processing

Server-Side Verification (without RFID chip processing)

How to activate Complete Server-Side Verification on Web Service

How to set up Mobile SDK

How to set up Web Components

Integration with Face SDK

Integration with Face SDK adds an automatic face match and search by a portrait taken from the document (Visual Zone and RFID-chip) or a live owner photo. If it's configured in the settings, face match and search are started once the document processing is completed.

How to activate Integration with Face SDK on Mobile.

How to activate Integration with Face SDK on Web.

Online Processing

To ease the document processing on the mobile side and keep the mobile app size significantly smaller, you can perform all document processing on the Web Service while the Mobile SDK is just used for capturing document images. In this case, there is no need to add the Core framework, documents database and have the mobile app licensed. Thus, automatic detecting the document boundaries and cropping become unavailable on the mobile side.

  • Manual mode

Scheme of the online processing manual mode

In case you want automatic detecting the document boundaries and cropping to be available on the mobile side, you need to add the Core framework and the documents database (if necessary). Thus, you need to choose the Auto mode.

  • Auto mode

Scheme of the online processing auto mode

How to set up Online Processing

Next Steps