> 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-ios-swift.md).

# Guía de Integración con el SDK para iOS (Swift)

### 1. Añadir el XCFramework

Integra el XCFramework en tu proyecto de Xcode de manera automatizada mediante CocoaPods o realiza una instalación manual.

[Ir a añadir el XCFrameworka →](#id-1.-anadir-el-xcframework)

### 2. Configuración del SDK (Swift)

Aprende a instanciar el componente principal `PayvalidaAntifraudSdk`. Define si operarás en entorno de `sandbox` o `production` y configura el objeto `ThreedsConfig` con la información de tu comercio para habilitar protocolos de autenticación.

[Ir a configuración del SDK (Swift) →](#id-2.-configuracion-del-sdk-swift)

### 3. Ejemplo de Uso (Swift)

Implementa la lógica de validación en dos etapas: la verificación inicial de riesgo durante el tipado de tarjeta y la ejecución del flujo 3DS (si es requerido).&#x20;

{% hint style="info" %}
Incluye guías sobre el mapeo de tipos (`Int32`, `Bool`) esenciales para Swift.
{% endhint %}

[Ejemplo de Uso (Swift) →](#id-3.-ejemplo-de-uso-swift)

### Referencia de la API

Consulta el diccionario completo de clases, propiedades y métodos. Encuentra las especificaciones detalladas de los objetos `FormData`, `Config` y los modelos de respuesta para un control total sobre la integración.

[Ir a referencia de la API →](#referencia-de-la-api)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.payvalida.com/api-tarjeta/master/sdk-para-3ds-y-score-de-riesgo-transaccional/guia-de-integracion-con-el-sdk-para-ios-swift.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
