> 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/android/integration-steps.md).

# Integration Steps

## Import VIDA VidaShield

The first step is to import the VidaShield class into your Application, Activity or Fragment.\
This class serves as the entry point for all operations — initialization, starting and submitting the data for verification, and releasing resources.

```kotlin
import id.vida.vidashield.VidaShield
```

## Initialize Fraud Shield SDK

In order to use the fraud shield SDK it is necessary to initialize the SDK with mandatory and optional parameters such as clientTransactionID, userHashId, Flow type etc.

<table><thead><tr><th width="189.62109375">Option</th><th width="87.11328125">Type</th><th>Description</th></tr></thead><tbody><tr><td>clientTransactionID</td><td>String</td><td><strong>Mandatory</strong> : This is client’s transactionID for the specific flow, this will also used by customer to fetch the fraud details from backend</td></tr><tr><td>userId</td><td>String</td><td><p><strong>Mandatory</strong>: UserID or hash of the UserID. <br></p><p><strong>Purpose:</strong><br></p><ul><li>Identity Persistence: Maintains a consistent identifier for the user across different devices and app lifecycles (e.g., recognizing a user after an uninstall and reinstall).</li><li>Device Monitoring: Enables the system to track how many unique users authenticate on a single physical device, ensuring compliance with established security or operational rules.</li></ul></td></tr><tr><td>Flow</td><td>String</td><td><strong>Optional</strong>: This is the flow type where SDK is used for example : login, profile page, transaction page etc.</td></tr><tr><td>apiKey</td><td>String</td><td><strong>Mandatory</strong>: This is provided by VIDA</td></tr><tr><td>licenseKey</td><td>String</td><td><strong>Mandatory</strong>: This is provided by VIDA</td></tr><tr><td>clientId</td><td>String</td><td><strong>Mandatory</strong>: This is provided by VIDA</td></tr></tbody></table>

<details>

<summary>Initialize SDK </summary>

```kotlin
private fun initializeSDK(customerTransactionID: String) {
val vidaShieldConfig = VidaShieldConfig(
    apiKey = KeyConstant.API_KEY,
    licenseKey = KeyConstant.LICENSE_KEY,  
    clientId = KeyConstant.CLIENT_ID, 
    clientTransactionId = customerTransactionID,
    userHashId = UserIDManager.getUUID(applicationContext),
    flow = getString(R.string.login)
        )
        try {
            if (!VidaShield.shared.isInitialized()) {
                VidaShield.shared.initialize(applicationContext, vidaShieldConfig)
            }
        } catch (exception: VIDAException) {
            // VIDA SDK Exception with proper error codes
        }
    }

//Note: If isInitialized() returns true, it indicates that the //SDK is already initialized. If the application needs to //reinitialize the SDK due to a configuration update, use the //updateConfiguration() API. To force a fresh initialization, //call release() first and then initialize the SDK again.
```

</details>

## isSDKInitialized() method&#x20;

This method checks whether the SDK has been initialized and returns the status as a boolean (<mark style="color:$success;">`true`</mark> or <mark style="color:$danger;">`false`</mark>)

## Call SubmitData API

`submitData()` is an asynchronous SDK method that initiates the submission of collected data to the VIDA server for analysis. Customers can then call VIDA’s backend API to retrieve transaction details using the `clientTransactionID.`

The **Application** (or calling component) must implement `VidaShieldResult`. The SDK invokes the `onResult()` callback once processing is complete.

onResult(response: VidaShieldResponse)&#x20;

&#x20;     Called by the SDK after data submission. `VidaShieldResponse` contains: &#x20;

* **status** → indicates success or failure
* **successDetails** → additional data or error information returned by the SDK
* **errorDetails** → error information like error code and error message. Application should log this information.&#x20;

```kotlin
VidaShield.shared.submitData(object : VidaShieldResult{
   	override fun onResult(response: VidaShieldResponse) {
                    // continue business logic
                }
       })
```

```kotlin
data class VidaShieldResponse(
    val status: Boolean,
    val successDetails: VidaShieldSuccessDetails?,
    val errorDetails: VidaShieldErrorDetails?
)

data class VidaShieldErrorDetails(
    val errorCode: Int?,
    val errorMessage: String?
)

data class VidaShieldSuccessDetails(
    val clientTransactionId: String
)
```

## updateConfiguration API

`updateConfiguration()` is an a**synchronous SDK API** that allows applications to update configuration parameters **after SDK initialization.**

This API is useful when certain values—such as **flow type, transactionId**, or other runtime parameters—are not available during initial SDK setup and need to be updated later in the user journey.

```kotlin
VidaShield.shared.updateConfiguration(
    config: VidaShieldUpdateConfig,
    result: VidaShieldConfigResult
)
```

The application must implement `VidaShieldConfigResult.`\
The SDK returns the result via the `onResult()` callback.

```kotlin
interface VidaShieldConfigResult {
    fun onResult(response: VidaShieldConfigResponse)
}
```

```kotlin
VidaShield.shared.updateConfiguration(config, object : VidaShieldConfigResult {
override fun onResult(response: VidaShieldConfigResponse) {
if (response.status) {
            // Configuration updated successfully
        } else {
            // Configuration update failed
            val error = response.error
        }
    }
})
```

## Release Resources

```kotlin
VidaShield.shared.release()
```

Releasing resources after completing a functionality is essential. It ensures that all threads and temporary memory allocations used by the SDK are properly cleaned up. Calling release() after a session completes helps free SDK-related objects from memory.
