> 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/landing/metodos-de-integracion/landing-sdk/configuracion.md).

# Configuration

Configuring Landing SDK in a frontend environment.

Landing SDK can be instantiated in different ways to accommodate the various use cases.

Below are the most common ones:

***

### Creating the default Landing SDK object

To create an instance of the associated Landing, use the Landing SDK constructor:

```javascript
const landingSDK = new LandingSDKClient('YOUR_APIKEY');
```

This instance will use the default configuration.

You can now use the methods offered by Landing SDK.

***

### Configuration with a unique URL

{% hint style="info" %}
This method is only available starting with version 0.4.0.
{% endhint %}

The SDK can generate a unique URL for landing pages. This URL is valid for 15 minutes. After that time, it will expire and a new one must be generated. It is important to configure the parameter in Builder that allows you to disable public access to landing pages.

To enable this method, use the following configuration:

```javascript
const landingSDK = new LandingSDKClient('YOUR_APIKEY',  {
  uniqueUrl: true
});
```

***

### **Configuration with an iframe**

The Landing SDK allows the landing page to open in an iframe that overlays the customer's page.

To enable this method, use the following configuration:

```javascript
const landingSDK = new LandingSDKClient('YOUR_APIKEY',  {
  iframe: true
});
```

{% hint style="warning" %}
**Note**: If you use the components inside an **iframe** it is necessary to **keep the focus within the container** that integrates the SDK Web components.
{% endhint %}

{% hint style="info" %}
To enable the SDK's iframe mode, Facephi support must configure the URLs allowed to embed the iframe. This is a critical security measure designed to protect your application and your users.

If the allowed URLs are not configured correctly, attackers could embed the iframe on unauthorized websites to impersonate your brand. This could lead to phishing attacks targeting your customers and potentially compromise sensitive information.

By applying URL restrictions, only trusted and preconfigured domains can use the iframe, significantly reducing the risk of such attacks.

If you need iframe mode for your Integration, please contact the Facephi support team and provide a list of the URLs where the iframe will be embedded.
{% endhint %}

{% hint style="danger" %}
With this method enabled, when the `callLanding`method is called, the landing page will be added to the customer's page in an iframe. Note that this iframe is positioned to occupy 100% of the page on a layer with `zIndex 100000`. That is, if an element is placed with a higher `zIndex` , it will overlay the landing page.
{% endhint %}

Once the landing page process is complete, the iframe will close. If you want to run functionality after the landing page process has finished, you can use the following method, which runs afterward:

```javascript
landingSDK.callLanding({
    onFinish: () = {
      /// Run your code here
    }
  })
```
