VTEX Device Fingerprint
This page provides a guide to integrate DEUNA's device fingerprint with VTEX Widget V2.
Benefits of device fingerprint
The new version of DEUNA's Widget introduces an innovative way to handle multiple fraud engines with just a few lines of code.
This functionality allows centralizing all relevant information in a single place, facilitating control and management by the merchant.
Among the benefits are:
- Clean Implementation: No need to implement additional scripts for anti-fraud engines; the widget automatically handles this process. You only need to enter the desired fraud engine and its credentials to activate it.
- Information Centralization: All your anti-fraud engine configuration data is kept in one place, making it easier to manage.
- Automation and updates: We manage the necessary updates and send fraud information to VTEX and the payment processor you configure.
- Flexibility in payment rules: You can configure multiple engines for different payment rules from the DEUNA administrator, ensuring information is sent correctly.
Requirements
These are the requirements to integrate VTEX's device fingerprint:
- DEUNA administrator credentials.
- Anti-fraud engine credentials to configure.
Integrate device fingerprint
Integrate VTEX's device fingerprint by following these steps:
1. Add fraudCredentials to your configuration
Configure your script by adding the fraudCredentials
option within the configuration attributes.
Anti-fraud engine configuration is an optional part of the script you just configured.
function loadScriptWithAttributes(url, attributes, target) {
return new Promise((resolve, reject) => {
const script = document.createElement('script');
script.src = url;
if (attributes) {
Object.keys(attributes).forEach(key => {
script.setAttribute(key, attributes[key]);
});
}
script.onload = resolve;
script.onerror = reject;
const currentTarget = target ?? document.head
if (!currentTarget) {
console.error("'currentTarget': is not defined")
}
currentTarget.appendChild(script);
});
}
const baseURL = "https://cdn.stg.deuna.io/snippets/v1.0.0/index.js";
console.log("DEUNA cdn: ", baseURL);
const attributes = {
env: "ENVIRONMENT",
publicApiKey: "API_KEY",
fraudCredentials: JSON.stringify({ // THIS IS WHAT YOU ADD TO SUPPORT ANTI-FRAUD ENGINES
CLEARSALE: {
"Client Id": "CLEARSALE_CREDENTIAL"
}
})
};
loadScriptWithAttributes(baseURL, attributes)
.then(() => {
console.log("DEUNA: loaded script Succesfully!")
})
.catch((err) => {
console.error("DEUNA: Error load script cdn: ", err);
});
2. Select the provider
Select anti-fraud engine providers from the available engines for device fingerprint
Consult Global Providers or the Anti-fraud Engines offering for more information.
The following table contains attributes for engines supported by the widget:
Name | Attributes | Example |
---|---|---|
SIGNIFYD | No parameters required at merchant_id level | fraudCredentials: { SIGNIFYD: {} } |
SIFT | accountId, restApiKey | fraudCredentials: { SIFT: { accountId: '', restApiKey: '' } } |
CLEARSALE | ClientId | fraudCredentials: { CLEARSALE: { clientId: '' } } |
CLEARSALE-BRASIL | ClientId | fraudCredentials: { CLEARSALE-BRASIL: { clientId: '' } } |
CYBERSOURCE | orgId, merchantId | fraudCredentials: { CYBERSOURCE: { orgId: '', merchantId: '' } } |
STRIPE | API_KEY | fraudCredentials: { STRIPE: { apiKey: '' } } |
MERCADOPAGO | // No parameters required at merchant_id level | fraudCredentials: { MERCADOPAGO: {} } |
BAZ | orgId, merchantId | fraudCredentials: { BAZ: { orgId: '', merchantId: '' } } |
Updated 2 days ago