@idpass/smartscanner-cordova

    0.3.15 • Public • Published

    SmartScanner Cordova

    Cordova plugin for the SmartScanner Core library to scan MRZ, NFC and barcodes.

    Installation

    This plugin can be installed from NPM:

    # Using npm
    npm install @idpass/smartscanner-cordova
    
    # Using yarn
    yarn add @idpass/smartscanner-cordova
    
    # Then let cordova know about the plugin
    cordova plugin add @idpass/smartscanner-cordova

    Usage

    The plugin is available in the cordova.plugins object, which is the registry of all available plugins.

    const { SmartScannerPlugin } = cordova.plugins;

    MRZ scanning example:

    const result = await SmartScannerPlugin.executeScanner({
      action: 'START_SCANNER',
      options: {
        mode: 'mrz',
        mrzFormat: 'MRTD_TD1',
        config: {
          background: '#89837c',
          branding: false,
          isManualCapture: true,
        },
      },
    });

    NFC scanning example:

    const result = await SmartScannerPlugin.executeScanner({
      action: 'START_SCANNER',
      options: {
        mode: 'nfc-scan',
        config: {
          background: '#89837c',
          branding: false,
          isManualCapture: true,
        },
      },
    });

    Barcode scanning example:

    const result = await SmartScannerPlugin.executeScanner({
      action: 'START_SCANNER',
      options: {
        mode: 'barcode',
        barcodeOptions: {
          barcodeFormats: [
            'AZTEC',
            'CODABAR',
            'CODE_39',
            'CODE_93',
            'CODE_128',
            'DATA_MATRIX',
            'EAN_8',
            'EAN_13',
            'QR_CODE',
            'UPC_A',
            'UPC_E',
            'PDF_417',
          ],
        },
        config: {
          background: '#ffc234',
          label: 'Sample Label',
        },
      },
    });

    Refer to the API Reference for more information about the available API options and the returned result.

    Related projects

    License

    Apache-2.0 License

    Install

    npm i @idpass/smartscanner-cordova

    DownloadsWeekly Downloads

    38

    Version

    0.3.15

    License

    Apache-2.0

    Unpacked Size

    8.41 MB

    Total Files

    11

    Last publish

    Collaborators

    • arnellebalane
    • jeremi.joslin
    • reubenm