SDK Initialization
The init method initializes the Vida Web SDK and configures its behaviour. This method accepts an options object that allows customization of the SDK's functionality, appearance, and localization. Below is a detailed breakdown of all the parameters available in the InitOptions interface.
Parameters
token
string
Yes
The bearer token obtained from Vida SSO. Used for authentication.
signingKey
string
Yes
The signing key shared by Vida. Required for secure SDK initialization.
env
string
Yes for npm based integration
This is required only if your integration method is via npm package. Environment values are production / sandbox
elementId
string
No
The ID of the HTML element where the SDK will be rendered. If not provided, the SDK will create an element and render the SDK.
fraudShieldClientId
string
No
Client ID to enable device fraud detection. Mandatory if ID fraud shield needs to be enabled.
onComplete
(data: IdentityVerificationResponse) => void
Yes
Callback executed when the liveness/ Onboarding process is completed successfully. The response data is passed as an argument.
onError
(data: IdentityVerificationResponse) => void
No
Callback executed if an error occurs during the identity verification process either in the client side or in the API. The error data is passed as an argument.
onDocVerificationSuccess
(data: IdentityVerificationResponse) => void
No
Callback executed when doc verification is successful.
onDocVerificationError
(data: IdentityVerificationResponse) => void
No
Callback executed when doc verification is api is errored out.
onSelfieCapture
(image: string) => void
No
Callback executed when a selfie is captured. The captured image (Base64 string) is passed as an argument.
onDocFaceMatchError
(data: IdentityVerificationResponse) => void
No
Callback executed when document face match api is errored out.
hideNetworkStatusAlert
boolean
No
Passing this true will hide network status (internet connectivity / offline ) alert.
locale
string
No
Language code for localization (e.g., "EN" for English, "ID" for Indonesian). Defaults to browser language if not specified. Falls back to EN if browser language is not available/applicable.
workflow
"identity-verification"
Yes
Specifies the workflow. use “identity-verification” for identity verification ( KYC ) flow.
countryCode
'MYS' | 'PHL' | 'IDN' | 'SGP' | 'THA' | 'VNM'
No
ISO3 country code for the Identity Verification flow. Defaults to MYS ( Malaysia )
partnerTransactionId
string
No
A unique transaction ID provided by the partner for tracking purposes. Note: Maximum 100 characters. Values longer than this will cause the request to fail.
userInfo.id
string
No
UserID or hash of the UserID. This will help to configure rules around users. Note: Maximum 100 characters. If not provided, the SDK uses a default value.
workflowConfigs
object
No
Configuration options specific to the identity verification workflow.
localeConfigs
object
No
Custom localization configurations.
themeConfigs
object
No
Custom styling options to align the SDK with your brand's design.
Last updated
