📁 Table of Contents
Table of Contents |
---|
...
ℹ️ Introduction
...
Customize the script with the following required properties:
Code Block language none IdvSdk.load({ mode: IdvSdkMode.Sandbox, onSuccess: (props) => console.log('onSuccess', props), onFailure: (props) => console.log('onFailure', props), onClose: () => console.log('onClose'), });
Both
begin()
andload()
should be used in try catch block.load
()Purpose: Configures api.
Returns
begin()
andend()
methods if successmode
interface(for setting environment):Code Block declare enum IdvSdkMode { Production = "Production", Sandbox = "Sandbox" }
Exceptions explained:
Code Block declare enum IdvSdkLoadFailure { NotSupportedMode = 'NotSupportedMode' // incorrect mode(environemnt) provided }
...
After setting up properties for IDV SDK
load({mode,onSuccess, onFailure})
begin()
Purpose: Creates idv session.
Props exaplainedexplained:
Code Block language json idvSdk?.begin({ idvSetupId: 'xxxxxx-xxxx', // Either setupid or idvId needs to be provided, idvId overrides setupId property idvId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', // unique idvId retry: false, // set to true if idvId is saved in the session storage for example so that browser page could be 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', }
When using
idvId
, it is recommended to save the idvID in your application's session storage.In the case of an F5 (page refresh), the same id will be used, and the same session will be loaded. If you encounter this scenario,
retry: true
should only be set after the refresh. Otherwise, when refreshing the page, idvId would be invalidated.
Exceptions explained:
Code Block declare enum IdvSdkBeginFailure { CantBeUsedInIframe = "CantBeUsedInIframe", // Consumer cannot use this sdk in iframe. We restrict usage due to requiring full screen NoIdvId = "NoIdvId", // 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()
Closes SDK application without error. Cleans ups up all sdk tasks and application.
Props: does not accept any properties.
...