Skip to content

Document Reader SDK Architecture

This page provides the 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

Architecture diagram of Mobile SDK components

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 internal Core framework provides recognition functionality where all the processing happens. Only the API framework uses the Core framework. Developers cannot access the Core framework directly, but must reference it in the project.

Resources contain the document 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.

Regula provides 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. Web Components don't support RFID chip processing.

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.

Architecture diagram of Web Components

The Web Components package contains UI Web Components and the Document Reader SDK:

  • UI Web Components are intended to recognize identity documents with a built-in user interface.

  • The Document Reader SDK is intended to recognize identity documents and allows you to create your own user interface.

During document processing, these components interact 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. For details, see the OpenAPI specification.

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

You can configure Storage to collect data after processing is complete.

Document Reader Web Service with Storage

Depending on the Web Service configuration and usage, the Storage can keep the request and response, as well as additional data. For details, see How to connect Storage.

A database stores 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

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. Document data, device metadata, transaction information are also saved in the Storage and Database after the processing is completed. During the RFID chip reading (optional for physical documents) or mDL reading (via NFC), Regula Web Service is 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 to trust Regula Mobile SDK or Regula Web Components results.

Click here to expand the Complete Server-Side Verification scheme

Complete scheme of the Server-Side Verification

For Complete Server-Side Verification setup instructions for different components, see the articles:

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 the face match and search are configured in the settings, they start once the document processing is completed.

Architecture diagram of integration between Regula Document Reader Mobile SDK and Regula Face Web Service

Architecture diagram of integration between Regula Document Reader Web Service and Regula Face Web Service

Online Processing

The Online Processing feature allows you to partially or fully delegate the document processing from the Mobile SDK to the Web Service. Explore How to set up Online Processing and see the available modes further.

Manual mode

To simplify 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, you don't need to add the Core framework or documents database, and don't need to license the mobile app. The automatic document boundary detection and cropping become unavailable on the mobile side.

Scheme of the online processing in Manual mode

Auto mode

To make automatic detecting the document boundaries and cropping available on the mobile side, add the Core framework and the documents database (if necessary).

Scheme of the online processing in Auto mode

Next Steps