Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

blinkid-react-native

Package Overview
Dependencies
Maintainers
9
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blinkid-react-native - npm Package Compare versions

Comparing version 6.5.0 to 6.7.0

67

index.js

@@ -37,2 +37,27 @@ 'use strict';

* }
*
* -> 'scanWithDirectApi' takes the following parameters:
* 1. RecognizerCollection recognizerCollection: object containing recognizers to use for scanning
* 2. String frontImage: a Base64 format string that represents the front image of the document that will be used for processing with DirectAPI
* 3. String backImage: a Base64 format string that represents the back image of the document that will be used for processing with DirectAPI
* - backImage parameter is optional with the BlinkIdSingleSide recognizer, as only one side of the document is required. Pass 'null' or an empty string "" for this parameter in this case
* 4. String license: BlinkID base64 license key bound to application ID for Android or iOS. To obtain
* valid license key, please visit http://microblink.com/login or
* contact us at http://help.microblink.com
*
* OR
*
* Object license: containing:
* - mandatory parameter 'licenseKey': base64 license key bound to application ID
* for Android or iOS. To obtain valid license key, please visit
* http://microblink.com/login or contact us at http://help.microblink.com
* - optioanl parameter 'licensee' when license for multiple apps is used
* - optional flag 'showTrialLicenseKeyWarning' which indicates
* whether warning for trial license key will be shown
* in format
* {
* licenseKey: '<base64iOSLicense or base64AndroidLicense>',
* licensee: String,
* showTrialLicenseKeyWarning: Boolean
* }
*/

@@ -70,2 +95,44 @@ class BlinkIDWrapper {

}
async scanWithDirectApi(recognizerCollection, frontImage, backImage, license) {
try {
var licenseObject = license;
if (typeof license === 'string' || license instanceof String) {
licenseObject = { licenseKey: license };
}
var frontImageObject = frontImage;
if (typeof frontImage === 'string' || frontImage instanceof String) {
frontImageObject = { frontImage: frontImage };
}
var backImageObject = backImage;
if (typeof backImage === 'string' || backImage instanceof String) {
backImageObject = { backImage: backImage };
}
const nativeResults = await BlinkIDNative.scanWithDirectApi(recognizerCollection, frontImageObject, backImageObject, licenseObject);
if (nativeResults.length != recognizerCollection.recognizerArray.length) {
console.log("INTERNAL ERROR: native plugin returned wrong number of results!");
return [];
} else {
let results = [];
for (let i = 0; i < nativeResults.length; ++i) {
// native plugin must ensure types match
// recognizerCollection.recognizerArray[i].result = recognizerCollection.recognizerArray[i].createResultFromNative(nativeResults[i]);
// unlike Cordova, ReactNative does not allow mutation of user-provided recognizers, so we need to
// return results and let user handle them manually.
let result = recognizerCollection.recognizerArray[i].createResultFromNative(nativeResults[i]);
if (result.resultState != RecognizerResultState.empty) {
results.push(result);
}
}
return results;
}
} catch (error) {
console.log(error);
return [];
}
}
}

@@ -72,0 +139,0 @@

48

overlays/blinkidOverlays.js

@@ -83,4 +83,6 @@ import { OverlaySettings } from '../overlaySettings'

/**
* Language of UI.
/**
* If default overlay contains textual information, text will be localized to this language. Otherwise device langauge will be used
*
* example: "en"
*/

@@ -90,2 +92,9 @@ this.language = null;

/**
* Used with language variable, it defines the country locale
*
* example: "US" to use "en_US" on Android and en-US on iOS
*/
this.country = null;
/**
* Defines whether Document Not Supported dialog will be displayed in UI.

@@ -107,21 +116,22 @@ *

*
* Default: true
* Default: true
*/
this.showMandatoryFieldsMissing = true;
/**
* Option to configure back side scanning timeout.
*
* Default: 17000
* Option to configure back side scanning timeout.
*
* Default: 17000
*/
this.backSideScanningTimeoutMilliseconds = 17000;
/**
/**
* Message that is shown while scanning the barcode.
* If null, default value will be used.
*/
this.scanBarcodeText = null;
*/
this.scanBarcodeText = null;
/**
* Instructions for the user to move the document from the edge.
* If null, default value will be used.
* Instructions for the user to move the document from the edge.
* If null, default value will be used.
*/

@@ -131,3 +141,3 @@ this.errorDocumentTooCloseToEdge = null;

/**
* String: title of the dialog which is shown when the data on the document is not matching.
* String: title of the dialog which is shown when the data on the document is not matching.
* If null, default value will be used.

@@ -150,2 +160,16 @@ */

this.onboardingButtonTooltipDelay = 12000;
/**
* Defines whether torch button used for turning the flashlight on and off is shown on the screen during the scanning session.
*
* Default: true
*/
this.showTorchButton = true;
/**
* Defines whether exit (cancel) button used for cancelling the scan is shown on the screen during the scanning session.
*
* Default: true
*/
this.showCancelButton = true;
}

@@ -152,0 +176,0 @@ }

{
"name": "blinkid-react-native",
"version": "6.5.0",
"version": "6.7.0",
"description": "A small and powerful ID card scanning library. Powered by Microblink (www.microblink.com).",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -92,2 +92,7 @@ import { Recognizer, RecognizerResult } from '../recognizer'

/**
* The blood type of the document owner.
*/
this.bloodType = nativeResult.bloodType;
/**
* The classification information.

@@ -128,2 +133,10 @@ */

/**
* Returns DataMatchStateSuccess if data from scanned parts/sides of the document match,
* DataMatchStateFailed otherwise. For example if date of expiry is scanned from the front and back side
* of the document and values do not match, this method will return DataMatchStateFailed. Result will
* be DataMatchStateSuccess only if scanned values for all fields that are compared are the same.
*/
this.documentDataMatch = nativeResult.documentDataMatch;
/**
* The document number.

@@ -315,2 +328,7 @@ */

/**
* The sponsor of the document owner.
*/
this.sponsor = nativeResult.sponsor;
}

@@ -317,0 +335,0 @@ }

@@ -72,2 +72,7 @@ import { Recognizer, RecognizerResult } from '../recognizer'

/**
* The blood type of the document owner.
*/
this.bloodType = nativeResult.bloodType;
/**
* The raw camera frame.

@@ -264,2 +269,7 @@ */

/**
* The sponsor of the document owner.
*/
this.sponsor = nativeResult.sponsor;
/**
* Defines the data extracted from the visual inspection zone

@@ -266,0 +276,0 @@ */

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc