Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Current flow only allows to use SDK

...

📁 Table of Contents

Table of Contents

...

ℹ️ Introduction

The current flow only allows using the SDK by installing it through npm or using it as a script. See an example at the bottom of the page.

...

🔢 Latest version

  • Latest version is v1.x.x

  • Refer to Changelog for latest versions and changes.

...

🚥 Compatibility

  • 🟢 Supported: Only for web browsers (Chrome, Firefox, Safari, Edge etc.).

  • 🔴 Not supported: Native application languages like React-Native, Flutter etc. For that, please refer to Mobile SDK.

...

📂 How to install?

SDK flow explained in a sandbox environment:

  • Generate idvID from swagger https://app-idvapi-snd-ond.azurewebsites.net/swagger/index.html POST/v1/identity-verifications

    • Provide correct and existing setupId.

    • Each unique session requires a new generation

  • Add There are 2 ways to use the IDV SDK:

    1. Via npm - @Ondato-public/idv-sdk

    2. By adding a script to an application

     <script
    1. <script src="

    build
    1. {baseUrl}/index.1.

    0
    1. x.

    0
    1. x.min.js"></script>

The SDK can be utilized by generating an idv ID or by using idv setupId (where the idv id is generated automatically).

...

🔀 Flows explained

  • Customize the script with the following required properties:

    • Code Block
      languagenone
      IdvSdk.load({
                mode: 'IdvSdkMode.Sandbox',
                onSuccess: (props) => console.log('onSuccess', props),
                onFailure: (props) => console.log('onFailure', props),
                onClose: () => console.log('onClose'),
              });
      • Begin Both begin() and load() should be used in try catch block.

      • Loadload()

        1. Purpose: Configures api.

        2. Returns Begin and End begin() and end() methods if successPossible exception:

          NotSupportedMode : invalid
        3. mode

          has been passed.
        mode interface
        1. interface(for setting environment):

          • Code Block
            declare enum 
        SdkMode
          • IdvSdkMode {
              Production = "Production",
              Sandbox = "Sandbox"
            } 
        1. Exceptions explained:

          Code Block
          declare enum IdvSdkLoadFailure {
             NotSupportedMode = 'NotSupportedMode' // incorrect mode(environemnt) provided
          }

...

  • Events

    • onSuccess and

      onError

      onFailure: callback with returned props

      :

      , onClose without props.

    • On every callback idv sdk application is closed.

    • Exceptions explained:

      Code Block
      declare enum 
      SdkProcessFailure
      IdvSdkProcessFailure {
          ConsentDeclined = "ConsentDeclined", // if user declines consent, sdk application is closed and error is returned
          CurrentSessionIdvIdAndPassedIdvIdMismatch = "CurrentSessionIdvIdAndPassedIdvIdMismatch", // idvId was provided and retry: true flag is set but different idvId was provided in the session error is returned. Only valid for F5(refresh page) cases.
          FailureExit = "FailureExit", // When idv process gives a dead end reason and idv identification process failed, user is prompted with exit from sdk application button. Button is clicked - sdk application is closed and FailureExit is returned.
          Generic = "Generic", // An error during sdk application flow happened and we cannot provide the exact reason why the process failed. Sdk closes and returns Generic error. (Something similar like internal server error)
          NoIdvContainer = "NoIdvContainer", // If user closes sdk application in an unknown way and there is still an sdk application instance running.
          
      NoIdvId
      InvalidIdvId = "
      NoIdvId
      InvalidIdvId", // no accessToken and no idvId case.
          Unauthorized = "Unauthorized", // in case of invalid idvId, in case of expired idvId, in case of any other way invalidated idvId, in case of completed idvId, in case of idvId that does not belong to accessToken etc.
          Aborted = "Aborted", // if user aborts the process.
      }

...

  • After setting up properties for

    IdvSdk.

    IDV SDK load({mode,onSuccess, onFailure})

    a correct idvId needs to be copy and pasted.Begin

    • begin()

      • Purpose: Creates idv session.

      • Props explained:

        Code Block
        languagejson
        idvSdk?.begin({
          idvSetupId: 'xxxxxx-xxxx', // Either setupid or idvId needs to be provided, idvId overrides setupId property
          idvId: '
        16b47825
        xxxxxxxx-
        ed83
        xxxx-
        4b2e
        xxxx-
        bc24
        xxxx-
        4ef4a8c647f1
        xxxxxxxxxxxx', // unique idvId
          retry: 
        true
        false, // set to 
        flag
        true if idvId is saved in the session storage for example so that browser page could be 
        refresh
        refreshed multiple times without needing to generate new idvId.
          language?: 'bg-BG' // possible languages are listed below or can be found in the interface 
        });
          
        declare enum IdvLanguage {
          BgBg = 'bg-BG',
          CaEs = 'ca-ES',
          CsCz = 'cs-CZ',
          DeDe = 'de-DE',
          EnGb = 'en-GB',
          EsEs = 'es-ES',
          EtEe = 'et-EE',
          FrFr = 'fr-FR',
          LtLt = 'lt-LT',
          LvLv = 'lv-LV',
          NlNl = 'nl-NL',
          PlPl = 'pl-PL',
          PtBr = 'pt-BR',
          RoRo = 'ro-RO',
          RuRu = 'ru-RU',
          SqAl = 'sq-AL',
          UkUa = 'uk-UA',
          ViVn = 'vi-VN',
        }        
      • Recommended

        When using idvId, it is recommended to save the idvID in your

        applications

        application's session storage.

        • In the case of an F5 (page refresh case), the same id would will be used, and the same session would will be loaded. In this case If you encounter this scenario, retry: true must should only be set after the refresh. Otherwise, when refreshing the page, idvId would be invalidated.

      • Exceptions explained:

        Code Block
        declare enum 
        SdkBeginFailure
        IdvSdkBeginFailure {
        	CantBeUsedInIframe = "CantBeUsedInIframe", // Consumer cannot use this sdk in iframe. We restrict usage due to requiring full screen
        	
        InvalidIdvId
        NoIdvId = "
        InvalidIdvId
        NoIdvId", // 
        invalid idvId
        idvId or idv setup id was not provided
        	NotSupportedMode = "NotSupportedMode",// check if provided mode is invalid according to SdkMode 
        	ProcessStarted = "ProcessStarted", // if multiple idv begin were started error. You cannot start multiple identifications in the same page simultaniously. 
        	StartFailed = "StartFailed" //  if sdk applications has crashed for some reason when trying to initially load the sdk application. Due to nework error etc. 
        }
        End:
    • end()

      • Closes SDK application without error. Cleans

        ups

        up all sdk tasks and application.

      • Props: does not accept any properties.

      IdvSdk.

...

🖌️ Customization

  • customiseStyle(options)

    • This function allows to set some IDV SDK styles.

    • Optional.

    • Call before begin() method. to applie style.

      • Options:

        Code Block
        const options: IdvCustomiseStyleProps = {
          background: { // IDV SDK backround styles (optional).
            /**
            * IDV SDK backround opacity.
            * CSS property opacity.
            * Default is 0.9.
            */
            opacity?: number | null;
        
            /**
            * IDV SDK backround blur.
            * The radius of the blur in px / rem / em / etc.
            * Default is 0.375rem.
            */
            blur?: string | null;
          }
        }
  • version() returns current sdk version

  • Example how html file looks with an included sdk script:

...

🗃️ Examples

1️⃣ Script

View file
namescript_example.html

...

2️⃣ npm (React example):

  1. specify registry in .npmrc

    1. Code Block
      @ondato-public:registry=https://pkgs.dev.azure.com/Ondato/PublicNPM/_packaging/ondato-public-npm/npm/registry/ 
      
  2. in package.json specify version “@ondato-public/idv-sdk": "1.x.x" and npm install

  3. Example import can be found in App.tsx in idv_sdk_npm_example zip

View file
nameidvSDKidv_sdk_npm_example.html

...

zip

...

🗂️ Extra

1️⃣ Interfaces and declarations files

View file
nameidvSDKidv_interfaceinterfaces.es.d.ts

...

2️⃣ How to generate IDV ID?

...