@microblink/capture 1.0.7 → 1.1.0
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 +18 -3
- package/dist/capture.js +6980 -9023
- package/dist/capture.umd.cjs +37 -58
- package/dist/resources/DO_NOT_MODIFY_THIS_DIRECTORY.md +2 -0
- package/dist/resources/advanced/capture-wasm.data +0 -0
- package/dist/resources/advanced/capture-wasm.js +4039 -152
- package/dist/resources/advanced/capture-wasm.wasm +0 -0
- package/dist/resources/advanced-threads/capture-wasm.data +0 -0
- package/dist/resources/advanced-threads/capture-wasm.js +4483 -171
- package/dist/resources/advanced-threads/capture-wasm.wasm +0 -0
- package/dist/resources/advanced-threads/capture-wasm.worker.js +109 -1
- package/dist/resources/basic/capture-wasm.data +0 -0
- package/dist/resources/basic/capture-wasm.js +4036 -152
- package/dist/resources/basic/capture-wasm.wasm +0 -0
- package/dist/resources/capture-worker.js +2 -2
- package/dist/style.css +1 -1
- package/package.json +5 -8
- package/types/index.d.cts +1115 -12
- package/types/index.d.ts +456 -235
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
The Capture Browser SDK gives you the ability to auto-capture high-quality images of identity documents in a user-friendly way. The SDK provides you with a rectified image of the document, ensuring a high success rate in extracting document text or verifying the document's validity.
|
|
6
6
|
|
|
7
|
-
Users are guided to avoid glare, blurred images, bad lighting conditions, fingers
|
|
7
|
+
Users are guided to avoid glare, blurred images, bad lighting conditions, fingers covering the document, or too much tilt. The SDK is able to recognize if a document is single-sided (i.e., passport) or double-sided (i.e., driving license) and prompt the user to scan the back side of the document when needed.
|
|
8
8
|
|
|
9
9
|
In the results, you can obtain a cropped, perspective-corrected image of the document, along with the original frame. These can be processed by your webapp in any way required. The SDK is lightweight and can be easily integrated into your webapp, blending seamlessly with your design.
|
|
10
10
|
|
|
@@ -25,7 +25,7 @@ pnpm add @microblink/capture
|
|
|
25
25
|
|
|
26
26
|
## Obtaining a licence
|
|
27
27
|
|
|
28
|
-
A valid license key is required to initialize scanning. You can request a free trial license key after registering on [Microblink Developer Hub](https://account.microblink.com/signin). The license is bound to the
|
|
28
|
+
A valid license key is required to initialize scanning. You can request a free trial license key after registering on [Microblink Developer Hub](https://account.microblink.com/signin). The license is bound to the domain of your app.
|
|
29
29
|
|
|
30
30
|
## Hosting environment
|
|
31
31
|
|
|
@@ -39,7 +39,7 @@ Cross-Origin-Opener-Policy: same-origin
|
|
|
39
39
|
|
|
40
40
|
Otherwise, you will only be able to run the single-threaded version of the SDK.
|
|
41
41
|
|
|
42
|
-
In order to load the accompanying Wasm files and Web Workers, you also need to host them locally on your dev server. These files can be found inside the `node_modules/@microblink/capture/dist/resources` directory after installation.
|
|
42
|
+
In order to load the accompanying Wasm files and Web Workers, you also need to host them locally on your dev server. These files can be found inside the `node_modules/@microblink/capture/dist/resources` directory after installation. The `/resources` directory must be hosted without modification of the directory name or its contents.
|
|
43
43
|
|
|
44
44
|
The dev environments for the example apps have these set and you can use them as a reference.
|
|
45
45
|
|
|
@@ -159,6 +159,21 @@ All components rendered by the UI are nested under `.mb-style-scope` which provi
|
|
|
159
159
|
|
|
160
160
|
You can find details on the internal state of the capture process using the [`onFrameAnalysis`](/packages/capture-main/src/createCaptureSdk.ts#57) callback. This callback will provide you with an `ImageData` instance of the previously processed frame and the [`FrameAnalysisResult`](/packages/capture-wasm/src/FrameAnalysisResult.ts).
|
|
161
161
|
|
|
162
|
+
### Low-level access Direct API
|
|
163
|
+
|
|
164
|
+
This mode gives users the capability to directly interact with the `Analyzer` instance, bypassing the provided functionality in the Capture SDK such as camera and video management, user feedback, callbacks and state management.
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
import { createDirectApi } from "@microblink/capture";
|
|
168
|
+
|
|
169
|
+
const directApi = await createDirectApi({
|
|
170
|
+
licenseKey: "YOUR_LICENCE",
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
// The user is free to use methods available on
|
|
174
|
+
// the `directApi` to fit their use case
|
|
175
|
+
```
|
|
176
|
+
|
|
162
177
|
## Troubleshooting
|
|
163
178
|
|
|
164
179
|
### Integration problems
|