> For the complete documentation index, see [llms.txt](https://docs.facephi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.facephi.com/docs.facephi-en/products/idv-suite/flujos-and-integraciones/configuracion-tecnica-del-cliente/solucion-web/sdk-loader-idv/configuracion-del-sdk.md).

# SDK configuration

The SDK Loader is designed to be easily configured through the parameters passed to the function `loadSdk`. This function automatically creates and configures the element `<facephi-sdk-provider>`.

## Configuration parameters

{% content-ref url="/pages/46c45fad32fc0658b1c79cee9d1eb7f66c5ea76e" %}
[Configuration parameters](/docs.facephi-en/products/idv-suite/flujos-and-integraciones/configuracion-tecnica-del-cliente/solucion-web/sdk-loader-idv/configuracion-del-sdk/parametros-de-configuracion.md)
{% endcontent-ref %}

## Event handling

{% content-ref url="/pages/b68bac85bd3cf80cf808322cb247c8bb9690e915" %}
[Event control](/docs.facephi-en/products/idv-suite/flujos-and-integraciones/configuracion-tecnica-del-cliente/solucion-web/sdk-loader-idv/configuracion-del-sdk/control-de-eventos.md)
{% endcontent-ref %}

***

## Complete configuration example

```typescript
import { loadSdk } from '@facephi/sdk-loader';

const sdkElement = await loadSdk({
  apiKey: 'YOUR_APIKEY',
  containerId: 'sdk-container',
  customerId: 'user-12345',
});

if (sdkElement) {
  // Escuchar eventos del SDK
  sdkElement.addEventListener('emitIDVIntegration', (event) => {
    console.log('Integration event:', event);
  });
}
```

***

## Known issues with an incorrect APIKEY Integration

The most common problems and how to avoid them are described below.

{% stepper %}
{% step %}

### Web configuration error (CORS)

It is mandatory to provide Facephi with a valid web domain where the SDK will be used. If the SDK is deployed on a different web domain, a CORS (Cross-Origin Resource Sharing) error will appear.

#### How to avoid CORS errors?

* Make sure to correctly configure your application's URL in the "Connect" section when creating an Integration in IDV Suite
* Deploy the SDK only on the authorized domain.
  {% endstep %}

{% step %}

### Flow configuration error

The `apiKey` is linked to the products the customer has contracted, which are preconfigured by the Facephi support team. If a specific product is not configured, those components will not be rendered.

{% hint style="warning" %}
If the problems persist, contact the Facephi support team
{% endhint %}
{% endstep %}
{% endstepper %}
