TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published


DIVE SDK from IDScan.net plugin for Ionic Capacitor


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


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.


Only iOS platform Minimum deployment target of iOS 13.0


Working the plugin you can find on demo Ionic App


npm install @idscan/divesdk-plugin
npx cap sync


import divesdk from '@idscan/divesdk-plugin'


Note: Request an license key for the library by emailing sales@idscan.net or support@idscan.net



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:


                  "name":"Document Front",
                  "name":"Document PDF417 Barcode",

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.


Run scan process

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

Returns: Promise<{ value: any; }>


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

    configuration: JSON.stringify(DIVEconfiguration)
    divesdk.start().then((result) => {
      // result of scanning
      // error in scannign process
    // 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() => Promise<{ value: any; }>

Returns: Promise<{ value: any; }>


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


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';
    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 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)

Package Sidebar


npm i @idscan/divesdk-plugin

Weekly Downloads






Unpacked Size

51.8 MB

Total Files


Last publish


  • chel_dev
  • ngdizyuk
  • ltarasyuk
  • idscan.net