Introducing VIDA Identity Stack: All of VIDA, in one place 🎉
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Initialization

The init method initializes the Vida ID Fraud Shield 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 FraudShieldInit interface.

import { VidaIdFraudShield } from "vida-id-fraud-shield";

/* If using script tag, directly use - window.VidaIdFraudShield.init() */
VidaIdFraudShield.init({
  fraudShieldClientId: "your-fraud-shield-client-id", /* Pre-shared by VIDA */
  userId: "your-user-id", 
  flow: "your-flow", /* example: "login" */
  env: "production", // pass "sandbox" for sandbox env, This param is required only for integration via npm package
  onError: (error) => { /* In case of any error during the process, this callback will get invoked */
    console.error("Error during liveness:", error);
  },
});

Parameters

Parameter
Type
Required
Description

fraudShieldClientId

string

Yes

This is your fraud shield clientId, pre-shared by VIDA.

userId

string

Yes

UserID or hash of the UserID. This will help to configure rules around users.

flow

string

No

This is the flow type where SDK is used for example : login, profile page, transaction page etc.

env

string

Yes for npm based integration

This is required only if your integration method is via npm package. Environment values are production / sandbox

onError

(data: ErrorResponse) => void

No

Callback executed if an error occurs during the fraud shield process either in the client side or in the API. The error data is passed as an argument.

Last updated