> For the complete documentation index, see [llms.txt](https://docs.payvalida.com/api-tarjeta/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payvalida.com/api-tarjeta/master/sdk-para-3ds-y-score-de-riesgo-transaccional/guia-de-integracion-con-el-sdk-para-android/2.-configuracion-del-sdk-kotlin.md).

# 2. Configuración del SDK (Kotlin)

{% hint style="warning" %}
Antes de llamar a cualquier método del SDK, debes crear una instancia de <mark style="color:$success;">`PayvalidaAntifraudSdk`</mark> con un objeto <mark style="color:$success;">`Config`</mark> <mark style="color:$info;">.</mark>
{% endhint %}

&#x20;Si planeas usar <mark style="color:$success;">`startThreeDSValidator`</mark>, también debes proporcionar un <mark style="color:$success;">`threedsConfig`</mark>:

```kotlin
import com.payvalida.antifraud.*

val sdk = PayvalidaAntifraudSdk(
    config = Config(
        environment = Environment.SANDBOX, // O Environment.PRODUCTION
        isSinglePageApp = false,
        threedsConfig = ThreedsConfig(
            consumerAuthenticationInformation = ThreedsConsumerAuthenticationInformation(
                transactionMode = "01",
                mcc = "5818",
                requestorId = "tu-requestor-id",
                requestorName = "Nombre de tu Empresa"
            ),
            acquirerInformation = ThreedsAcquirerInformation(
                acquirerBin = "tu-acquirer-bin",
                merchantId = "tu-merchant-id"
            ),
            merchantInformation = ThreedsMerchantInformation(
                merchantDescriptor = ThreedsMerchantDescriptor(
                    name = "Nombre del Comercio",
                    url = "https://tu-dominio.com"
                )
            )
        )
    )
)
```

Si solo necesitas validación antifraude (sin 3DS), puedes omitir <mark style="color:$success;">`threedsConfig`</mark>:

```kotlin
val sdk = PayvalidaAntifraudSdk(
    config = Config(environment = Environment.SANDBOX)
)
```
