Document Reader SDK Architecture
This page explains how Document Reader SDK components process document data across mobile, web, and server-side environments.
- Document Reader Mobile SDK
- Document Reader Web Components
- Document Reader Web Service
- Complete Server-Side Verification
- Integration with Face SDK
- Online Processing
Document Reader Mobile SDK
The API framework provides the external interface for controlling document processing and receiving results. It depends on the Common framework, which works with the camera and other modules used in other Regula SDKs.
The internal Core framework provides recognition functionality. All document processing happens in this framework. Only the API framework uses the Core framework. Developers cannot access the Core framework directly, but must reference it in the project.
Resources contain document data. They are mandatory when you use a Core type that supports document type recognition.
The Document Reader Mobile SDK processes data completely offline. No data leaves your mobile device. You don't need to run the Document Reader Web Service.
Regula provides solutions for both Native and Hybrid apps:
- Android
- iOS
- Flutter
- JavaScript
- React Native
- .NET MAUI, formerly Xamarin
- Ionic
- Cordova
RFID chip processing requires NFC, so it is available only on mobile devices that use the Document Reader Mobile SDK. The Document Reader Web Components don't support RFID chip processing.
Document Reader Web Components
The Document Reader Web Components let you add document verification to your website. They capture a document from the device camera or process an uploaded image. They crop the image by document boundaries, then recognize the machine-readable zone (MRZ) and barcodes.
The Document Reader 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 communicates with WebAssembly (WASM).
WebAssembly (WASM) provides recognition functionality where all processing happens.
The Document Reader Web Components don't support Document Type and Visual Zone recognition. For further processing, send an image captured by the Document Reader Web Components to the Document Reader Web Service after processing is complete.
Document Reader Web Service
The Document Reader Web Service operates over HTTP or HTTPS. It receives a request and invokes the Core library to process it. When the Core library returns the results, the Document Reader Web Service sends them back.
The Document Reader Web Service is distributed as:
- Docker image
- Packages for Linux: Ubuntu, RHEL, and Debian
- Packages for Windows for x86 and x64 architectures
- Cloud deployments, for example, on Amazon Web Services
To use the Document Reader Web Service, you need to send an image and processing parameters via API. For details, see the OpenAPI specification.
To simplify integration and maintenance, Regula provides API clients for popular programming languages:
- JavaScript client for the browser and Node.js based on Axios
- Java client compatible with Java Virtual Machine (JVM) and Android
- Python client version 3.5+
- C# client for .NET and .NET Core
You can configure Storage to collect data after processing is complete.
Depending on the Document Reader Web Service configuration and usage, Storage can keep requests, responses, and additional data. For details, see How to connect Storage.
A database stores transaction information, public keys, and private keys. You must configure a database to use Complete Server-Side Verification.
Complete Server-Side Verification
Complete Server-Side Verification is an additional layer of protection against fraud. Smartphones and edge devices can complete authenticity checks, but results produced on the same device can be intercepted or modified. Complete Server-Side Verification helps reduce this risk.
In the zero-trust-to-mobile approach, document data, device metadata, and transaction information are saved in Storage and Database after processing is complete.
During optional RFID chip reading for physical documents or mDL reading through NFC, the Document Reader Web Service generates session keys and challenges. Storage and Database store these keys and challenges. During reprocessing, the Document Reader Web Service fetches data from Storage and Database. After reprocessing is complete, you can determine whether to trust the Document Reader Mobile SDK or Document Reader Web Components results.
For setup instructions for different components, see the following articles:
- Document Reader Web Service
- Document Reader Mobile SDK for physical documents
- Document Reader Mobile SDK for Mobile Driver's License
- Document Reader Web Components
Integration with Face SDK
Integration with the Face SDK adds automatic face match and search by a portrait from Visual Zone or RFID chip data, or by a live owner photo. If face match and search are configured in the settings, they start after document processing is complete.
Online Processing
The Online Processing feature allows you to partially or fully delegate document processing from the Document Reader Mobile SDK to the Document Reader Web Service. For setup instructions, see How to set up Online Processing. The following modes are available:
Manual mode
Use Manual mode to reduce the mobile app size and move document processing to the Document Reader Web Service. In this mode, the Document Reader Mobile SDK captures document images only. You don't need to add the Core framework or documents database, and you don't need to license the mobile app. Automatic document boundary detection and cropping become unavailable on the mobile side.
Auto mode
To make automatic document boundary detection and cropping available on the mobile side, add the Core framework and the documents database if needed.