npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@idscan/divesdk-plugin

v0.0.1

Published

DIVE SDK from IDScan.net plugin for Ionic Capacitor

Downloads

14

Readme

divesdk-plugin

DIVE SDK from IDScan.net plugin for Ionic Capacitor

Overview

Upon being switched on, the library integrates the component of capturing the documents and faces from a video to your Ionic Capacitor App.

Use cases

  • Capture and determination of the document type
  • Capture of pdf417
  • Capture of MRZ
  • Capture of faces

Recommendations

Use a modern phone with a good camera having the definition of not less than 8 megapixels. The capture must be made in a well-lighted room. A document must be located at the uniform background.

Limitations

Only iOS platform Minimum deployment target of iOS 13.0

Demo

Working the plugin you can find on demo Ionic App

Installation

npm install @idscan/divesdk-plugin
npx cap sync

Import

import divesdk from '@idscan/divesdk-plugin'

Configuration

Note: Request an license key for the library by emailing [email protected] or [email protected]

Methods

configure(...)

configure(options: { configuration: string; }) => Promise<void>

| Param | Type | | ------------- | --------------------------------------- | | options | { configuration: base64encoded configuration object; } |

This JSON configuration file describes the steps for scanning various types of documents using the DIVE SDK. The configuration includes settings for resizing uploaded images, automatic continuation, and real face mode. Here is the breakdown of the configuration:

Scructure:

{
  "resizeUploadedImage":-1,
  "autoContinue":true,
  "realFaceMode":"auto",
  "documentTypes":[
      {
          "isActive":true,
          "type":"ID",
          "steps":[
              {
                  "type":"front",
                  "name":"Document Front",
                  "mode":{
                      "uploader":true,
                      "video":true
                  }
              },
              {
                  "type":"pdf",
                  "name":"Document PDF417 Barcode",
                  "mode":{
                      "uploader":true,
                      "video":true
                  }
              },
              {
                  "type":"face",
                  "name":"Face",
                  "mode":{
                      "uploader":true,
                      "video":true
                  }
              }
          ]
      }]
}

Global Settings:

  • "resizeUploadedImage": The value -1 indicates that the uploaded images will not be resized.
  • "autoContinue":true: The value true enables automatic continuation of the scanning process.
  • "realFaceMode":"auto": The "auto" value allows the SDK to determine the most suitable mode for capturing real face images.

Document Types:

The configuration defines multiple document types, each with its own scanning steps:

  1. ID:

    • "isActive": bool: Enables scanning for this document type.
    • "type" : Indicates that this document type is an ID. "ID", "front", "pdf", "face"
    • "steps": Contains an array of steps required to scan an ID.
    • "name": Describes the step name.
    • "mode": Specifies the scanning mode for this step.
      • "uploader": bool: Allows image uploading for this step.
      • "video": bool: Allows video capturing for this step.
  2. Passport:

    • Similar structure as the ID document type but with different step names, indicating the scanning of passport documents.
  3. PassportCard:

    • Similar structure as the ID document type but with different step names, indicating the scanning of passport cards.
  4. GreenCard:

    • Similar structure as the ID document type but with different step names, indicating the scanning of GreenCards.
  5. InternationalId:

    • Similar structure as the ID document type but with different step names, indicating the scanning of international ID documents.

Note: All document types have "isActive":true set, indicating that they are all enabled for scanning.


start()

Run scan process

start() => Promise<{ value: any; }>

Returns: Promise<{ value: any; }>

Example:

import { divesdk } from '@idscan/divesdk-plugin'

divesdk.configure({
    configuration: JSON.stringify(DIVEconfiguration)
  }).then(()=>{
    divesdk.start().then((result) => {
      // result of scanning
    }).catch((error)=>{
      // error in scannign process
    });
  }).catch((error)=>{
    // error in configuration
  });

Result of scanning

{
  "documentType": 1, 
  "frontImageBase64": "string",
  "backOrSecondImageBase64": "string",
  "faceImageBase64": "string",
  "trackString": {
    "data": "string",
    "barcodeParams": "string"
  }
}

documentType (string or int) Type of document.

  • ID – 1
  • Passport - 2
  • PassportCard – 3
  • Common Access Card (Old Format) – 4
  • Common Access Card (New Format) – 5
  • GreenCard – 6
  • InternationalId – 7

frontImageBase64 (string) Front of the document which contains the data for OCR and a photo.

backOrSecondImageBase64 (string) Image of the reverse side or back of the document which contains the Barcode (PDF417) or MRZ.

faceImageBase64 (string) Image of the face of the document owner if it is necessary to compare it with the photo of the face on the document.

trackString.data (string)(optional) PDF417 barcode data (or MRZ data) encoded as a base64 string

trackString.barcodeParams (string)(optional)

You can send this data in DIVE SDK API for parse and check scanned images.

startDIVEOnline()

startDIVEOnline() => Promise<{ value: any; }>

Returns: Promise<{ value: any; }>


configureDIVEOnline(...)

configureDIVEOnline(options: { applicantID: string; publicToken: string; integrationID: string; sendLocation: boolean; baseURL?: string; }) => Promise<void>

Example:

import { divesdk } from '@idscan/divesdk-plugin';
// applicantID you can create in DIVE control panel https://diveonline.idscan.net/validationRequest
// or by API https://docs.idscan.net/dive/dive-online/swagger.html
// POST request /api/v2/private/Applicants use secret key 
const applicantID = '395c03fc-7239-48fe-b437-d7204812fa19';
 divesdk.configureDIVEOnline({
    applicantID: applicantID,
    publicToken: DIVEOnlinePublicToken,
    integrationID: DIVEOnlineIntegrationID,
    sendLocation: false
  }).then(() => {
    // Configuration Loaded
    divesdk.startDIVEOnline().then((result) => {
        // result of scanning applicant
    }).catch((error) => {
       // error scanning process
    });
  }).catch((error) => {
    // error fetching configuration
  })

iOS

iOS requires the following usage description be added and filled out for your app in Info.plist:

  • NSCameraUsageDescription (Privacy - Camera Usage Description)
  • NSPhotoLibraryAddUsageDescription (Privacy - Photo Library Additions Usage Description)
  • NSPhotoLibraryUsageDescription (Privacy - Photo Library Usage Description)

Read about Configuring Info.plist in the iOS Guide for more information on setting iOS permissions in Xcode

If you plan to send coordinates information, add the following permissions to the application

  • NSLocationAlwaysUsageDescription (Privacy - Location Always Usage Description)
  • NSLocationWhenInUseUsageDescription (Privacy - Location When In Use Usage Description)