Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@microblink/docver-in-browser-sdk

Package Overview
Dependencies
Maintainers
13
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microblink/docver-in-browser-sdk

This package is a wrapper around the [`blinkid-in-browser-sdk`](https://www.npmjs.com/package/@microblink/blinkid-in-browser-sdk).

latest
npmnpm
Version
2.0.2
Version published
Maintainers
13
Created
Source

This package is a wrapper around the blinkid-in-browser-sdk.

Along with providing the same exports as blinkid-in-browser-sdk, it also exposes the endpoint API types, and a few helpers for easier usage with Document Verification:

The initSDK function:

An optional, alternative way to initialize the BlinkID scanning process.

It provides an easy way to initialize all the necessary core objects (WasmSDK, BlinkIdCombinedRecognizer, RecognizerRunner and VideoRecognizer), preconfigured to capture images suitable for sending to a Document Verification endpoint. This allows for easier scoping and lifecycle management as well.

Usage:

// initialization using a video element and a licence key
const sdkCore = initSDK(videoElement, { licenceKey: "LICENCE_KEY", // ...other SDK options });

// the rest is the same as on BlinkID
const result = await sdkCore.videoRecognizer.recognize();

You can see this approach in the apps/example-sdk-only and apps/example-solidjs examples on the GitHub repository.

The imageDataToBase64 function:

Converts the BlinkID captured images which are of the type imageData to a base64 string required by the Document Verification API endpoint.

Usage:

const blinkIdResult: BlinkIdCombinedRecognizerResult = {
  /*...*/
};

const request: DocVerRequest = {
  imageFront: {
    imageBase64: imageDataToBase64(blinkIdResult.frontCameraFrame.frame),
  },
  imageBack: {
    imageBase64: imageDataToBase64(blinkIdResult.backCameraFrame.frame),
  },
  // ... other properties on the request
};

Alongside these two helper functions it also re-exports the DocVerResponse and DocVerRequest from @microblink/docver-in-browser-api so that the user needs to only install a single package.

FAQs

Package last updated on 23 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts