> For the complete documentation index, see [llms.txt](https://docs.vida.id/identity-stack/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vida.id/identity-stack/verify/id-fraud-shield-sdk/integration-guide/web-sdk/initialization.md).

# 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.

```java
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" */
  onError: (error) => { /* In case of any error during the process, this callback will get invoked */
    console.error("Error during liveness:", error);
  },
});
```

#### Parameters <a href="#parameters" id="parameters"></a>

<table><thead><tr><th width="215.33203125">Parameter</th><th>Type</th><th width="111.43359375">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>fraudShieldClientId</code></td><td><code>string</code></td><td>Yes</td><td>This is your fraud shield clientId, pre-shared by VIDA.</td></tr><tr><td><code>userId</code></td><td><code>string</code></td><td>Yes</td><td>UserID or hash of the UserID. This will help to configure rules around users.</td></tr><tr><td><code>flow</code></td><td><code>string</code></td><td>No</td><td>This is the flow type where SDK is used for example : login, profile page, transaction page etc.</td></tr><tr><td><code>onError</code></td><td><code>(data: ErrorResponse) => void</code></td><td>No</td><td>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.</td></tr></tbody></table>
