Configuration
Configuration of Landing SDK in a frontend environment.
Last updated
Configuration of Landing SDK in a frontend environment.
Landing SDK can be instantiated in different ways to adapt to the different available use cases.
Below we present the most common ones:
To create an instance of the associated Landing, we will use the Landing SDK constructor:
const landingSDK = new LandingSDKClient('YOUR_APIKEY');This instance will have the default configuration.
It will now be possible to use the methods offered by Landing SDK.
This method is only available starting from Version 0.4.0.
The SDK allows generating a unique URL for the destination pages; this URL will have a validation time of 15 minutes. After that time, the URL will be invalidated and a new one must be generated. It is important to configure in the Builder the parameter that allows you to disable public access to the destination pages.
To enable this method, the following configuration must be used:
const landingSDK = new LandingSDKClient('YOUR_APIKEY', {
uniqueUrl: true
});The Landing SDK allows the destination page to be launched in an iframe that will overlay the client's page.
To enable this method, the following configuration must be used:
Note: If the components are used inside a iframe it is necessary to keep the focus within the container that integrates the SDK Web components.
To enable the SDK's iframe mode, the Facephi support team must configure the allowed URLs 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 in unauthorized websites to impersonate your brand. This could lead to phishing attacks targeting your customers, which could compromise sensitive information.
By applying URL restrictions, only trusted and preconfigured domains will be able to use the iframe, which significantly reduces the risk of such attacks.
If you need iframe mode for your integration, please contact the Facephi support team to provide a list of the URLs where the iframe will be embedded.
With this method enabled, when the method callLanding, the destination page will be added within the client's page with an iframe. Note that this iframe is placed occupying 100% of the page in a layer with zIndex 100000. That is, if something is placed with a zIndex higher, it will overlay the destination page.
Once the destination page process is complete, the iframe will be closed. If you want to execute some functionality after the destination page process has finished, you have a method that runs below:
Last updated
const landingSDK = new LandingSDKClient('YOUR_APIKEY', {
iframe: true
});landingSDK.callLanding({
onFinish: () = {
/// Run your code here
}
})