Document Reader Web Components package contains a number of predefined and configurable components, as described in the table below.
Component | Description |
---|---|
Smart capture ( document-reader ) |
Recommended component for most cases, as it is easy to integrate yet flexibly configurable.
|
Snapshot ( camera-snapshot ) |
|
Advanced |
|
getUserMedia
method to display the video stream from the camera—this feature is available only in secure contexts.Devices | |||
---|---|---|---|
Mobile (iOS) | 99 | 99 | 11 |
Mobile (Android) | 66 | 63 | - |
Desktop | 61 | 63 | 11 |
To support the older browser versions in your project, install the required polyfill packages manually. Follow the link to npm package @webcomponents/webcomponentsjs for installation details.
1. Install the package vp-frontend-document-components:
npm i @regulaforensics/vp-frontend-document-components
2. Import the function defineComponents
and the class DocumentReaderService
into your .js
file:
import { defineComponents, DocumentReaderService } from '@regulaforensics/vp-frontend-document-components';
import { defineComponents, DocumentReaderService } from './node_modules/@regulaforensics/vp-frontend-document-components/dist/main.js';
Connect the script to your .html
file. Use a CDN link in the following format: unpkg.com/:package@:version/:file
.
For example:
<script src="https://unpkg.com/@regulaforensics/vp-frontend-document-components@latest/dist/main.iife.js"></script>
1. Add DocumentReaderService
to the global variable RegulaDocumentSDK
and set a processing scenario:
window.RegulaDocumentSDK = new DocumentReaderService();
window.RegulaDocumentSDK.recognizerProcessParam = {
processParam: {
scenario: 'MrzAndLocate',
},
};
window.RegulaDocumentSDK.imageProcessParam = {
processParam: {
scenario: 'MrzAndLocate',
},
};
2. Define the components and initialize the service:
defineComponents().then(() => window.RegulaDocumentSDK.initialize());
defineComponents().then(() => window.RegulaDocumentSDK.initialize({ license: '<BASE64_LICENSE_KEY>' }));
How to convert a license file to the Base64 string
!!! warning Once the development is finished and your product is ready to be exposed to the internet, make sure that you have removed the license from your source code.
3. Add the component tag to the .html
file:
<document-reader></document-reader>
1. Define the components:
defineComponents();
2. Add the component tag to the .html
file:
<camera-snapshot></camera-snapshot>
Regula Document Reader SDK Web Components Documentation
Regula Document Reader SDK Web Components API Reference
There are several project examples that demonstrate the integration way of Regula Document Reader SDK Web Components, visit our repository on GitHub.
Visit the Storybook website to see the live demo.
To submit a request to the Support Team, visit Regula Help Center.
To discuss business opportunities, fill the Enquiry Form and specify your scenarios, applications, and technical requirements.