@regulaforensics/idv-capture-web 3.1.221-rc → 3.1.224-rc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -13
- package/dist/main.iife.js +35 -34
- package/dist/main.js +5131 -5049
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,11 @@
|
|
|
5
5
|
- [Compatibility](#compatibility)
|
|
6
6
|
- [Install via NPM](#install-via-npm)
|
|
7
7
|
- [Install via CDN](#install-via-cdn)
|
|
8
|
+
- [Setup](#setup)
|
|
8
9
|
- [Events](#events)
|
|
10
|
+
- [Setters](#setters)
|
|
11
|
+
- [Getters](#getters)
|
|
12
|
+
- [Methods](#methods)
|
|
9
13
|
|
|
10
14
|
---
|
|
11
15
|
|
|
@@ -52,7 +56,6 @@ Install idv-capture-web:
|
|
|
52
56
|
|
|
53
57
|
```
|
|
54
58
|
npm i @regulaforensics/idv-capture-web
|
|
55
|
-
npm i @regulaforensics/idv-gui
|
|
56
59
|
|
|
57
60
|
#optionally
|
|
58
61
|
|
|
@@ -66,7 +69,6 @@ Import `@regulaforensics/idv-capture-web` into your `index.js`:
|
|
|
66
69
|
|
|
67
70
|
```javascript
|
|
68
71
|
import './node_modules/@regulaforensics/idv-capture-web/dist/main.js';
|
|
69
|
-
import './node_modules/@regulaforensics/idv-gui/dist/main.js';
|
|
70
72
|
```
|
|
71
73
|
|
|
72
74
|
In `index.html` connect `index.js` and add the name of the component you want to use. Available components:
|
|
@@ -97,14 +99,13 @@ For example:
|
|
|
97
99
|
|
|
98
100
|
```html
|
|
99
101
|
<script src="https://unpkg.com/@regulaforensics/idv-capture-web@latest/dist/main.iife.js"></script>
|
|
100
|
-
<script src="https://unpkg.com/@regulaforensics/idv-gui@latest/dist/main.iife.js"></script>
|
|
101
102
|
|
|
102
103
|
<script src="https://unpkg.com/@regulaforensics/idv-face@latest/dist/main.iife.js"></script>
|
|
103
104
|
<script src="https://unpkg.com/@regulaforensics/idv-document@latest/dist/main.iife.js"></script>
|
|
104
105
|
|
|
105
106
|
```
|
|
106
107
|
|
|
107
|
-
Add the
|
|
108
|
+
Add the component tag to your HTML, as shown in the example above.
|
|
108
109
|
|
|
109
110
|
## Setup
|
|
110
111
|
|
|
@@ -113,10 +114,9 @@ Use `IdvIntegrationService` to setup idv flow.
|
|
|
113
114
|
General example of the integration step by step
|
|
114
115
|
|
|
115
116
|
```javascript
|
|
116
|
-
/** import necessary service
|
|
117
|
+
/** import necessary service */
|
|
117
118
|
import { IdvIntegrationService } from '@regulaforensics/idv-capture-web';
|
|
118
|
-
|
|
119
|
-
/** depends of your workflow */
|
|
119
|
+
/** and packages depends of your workflow */
|
|
120
120
|
import { FaceIdv } from "@regulaforensics/idv-face";
|
|
121
121
|
import { DocumentIdv } from "@regulaforensics/idv-document";
|
|
122
122
|
|
|
@@ -133,12 +133,12 @@ const idvEventListener = (event) => {
|
|
|
133
133
|
service.sessionRestoreMode = true;
|
|
134
134
|
service.eventListener = idvEventListener;
|
|
135
135
|
|
|
136
|
-
/** for convenience, we will use an asynchronous function. You also
|
|
136
|
+
/** for convenience, we will use an asynchronous function. You can also use Promises */
|
|
137
137
|
(async function () {
|
|
138
138
|
/** set modules */
|
|
139
139
|
const initResult = await service.initialize({
|
|
140
140
|
modulesConfig: { docreader: { devLicense: 'yourBase64license' } },
|
|
141
|
-
includedModules: [
|
|
141
|
+
includedModules: [FaceIdv, DocumentIdv],
|
|
142
142
|
});
|
|
143
143
|
/** if something goes wrong, the command error will contain an error field. */
|
|
144
144
|
if (initResult.error) {
|
|
@@ -147,7 +147,7 @@ service.eventListener = idvEventListener;
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
const configureResult = await service.configure({
|
|
150
|
-
|
|
150
|
+
baseUrl: 'https://your.host.com',
|
|
151
151
|
userName: '',
|
|
152
152
|
password: '',
|
|
153
153
|
});
|
|
@@ -179,6 +179,26 @@ service.eventListener = idvEventListener;
|
|
|
179
179
|
})();
|
|
180
180
|
```
|
|
181
181
|
|
|
182
|
+
**Alternative configure options:**
|
|
183
|
+
|
|
184
|
+
Using **apiKey**:
|
|
185
|
+
|
|
186
|
+
```javascript
|
|
187
|
+
const configureResult = await service.configure({
|
|
188
|
+
baseUrl: 'https://your.host.com',
|
|
189
|
+
apiKey: 'your apiKey',
|
|
190
|
+
ttl: 86400,
|
|
191
|
+
});
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Using **url**:
|
|
195
|
+
|
|
196
|
+
```javascript
|
|
197
|
+
const configureResult = await service.configure({
|
|
198
|
+
url: 'your url with token',
|
|
199
|
+
});
|
|
200
|
+
```
|
|
201
|
+
|
|
182
202
|
## Events
|
|
183
203
|
|
|
184
204
|
You can subscribe to the component events.
|
|
@@ -194,9 +214,10 @@ For example:
|
|
|
194
214
|
const service = new IdvIntegrationService();
|
|
195
215
|
service.eventListener = idvEventListener;
|
|
196
216
|
```
|
|
217
|
+
|
|
197
218
|
## Setters
|
|
198
219
|
|
|
199
|
-
`nonce` - set CSP nonce id to the style tag
|
|
220
|
+
`nonce` - set CSP nonce id to the style tag
|
|
200
221
|
|
|
201
222
|
```javascript
|
|
202
223
|
const service = new IdvIntegrationService();
|
|
@@ -226,8 +247,8 @@ Check types in the `index.d.ts`
|
|
|
226
247
|
|
|
227
248
|
|
|
228
249
|
`async configure(
|
|
229
|
-
config:
|
|
230
|
-
): Promise<ConfigureCompletion |
|
|
250
|
+
config: CredentialConnectionConfig | TokenConnectionConfig | ApiKeyConnectionConfig,
|
|
251
|
+
): Promise<ConfigureCompletion | TokenConfigureCompletion>` - configures the service. accepts input parameters for connecting to the platform
|
|
231
252
|
|
|
232
253
|
`async getWorkFlows(params?: WorkflowListRequest): Promise<WorkflowListCompletion>` - returns list of available workflows
|
|
233
254
|
|