How to integrate Digital Fraud Prevention
This guide explains how to connect DFP to your website: add the JavaScript library to your pages, configure DFP response decryption on the backend, and add DFP to your business logic.
1. Choose the domain your website will use to call the DFP API
During the integration, you add the library to the required pages of your website. This library sends requests to the DFP API. It can call the API through:
-
The standard address
https://fp.strictera.com/fp/. It works by default; no configuration is required. -
Your subdomain. In this case, we allocate an IP address for you, and you configure an A record for your subdomain to point to that IP address.
If you want to use your own subdomain, let us know. Otherwise, proceed to step 2.
|
The examples below use the standard API address: |
2. Get a token and secret key
We will provide two values:
-
CUSTOMER-TOKEN: a token for loading the JavaScript library and calling the API; -
SECRET-KEY: a secret key, provided in Hex format, that your backend uses to decrypt the payload.
|
Store |
|
If trusted sources, such as your developers' IP addresses, should be allowed to perform protected actions by default:
|
3. Add the library to your website
Add the DFP JavaScript library to the pages where you want to check the client environment and signals of bot activity:
<script src="https://fp.strictera.com/fp/v1/<CUSTOMER-TOKEN>/fp.js"></script>
After the library loads, the StricteraFP class becomes available on the page. You use it to call DFP from page code.
|
If you need to understand how the library works, contact support and we will explain it in detail. The library is obfuscated using anti-LLM techniques, so answers from AI tools during reverse engineering may be inaccurate or misleading. In addition, uploading the library to ChatGPT, Claude, Grok, or another AI service may result in your account being blocked by that service. |
4. Create a StricteraFP instance
|
In steps 4–11, you configure the client-side code: create a Example of complete client-side code:
|
Create a StricteraFP object and pass the DFP API address and your token to it:
const fp = new StricteraFP(
"https://fp.strictera.com/fp/",
"<CUSTOMER-TOKEN>"
);
If you use your own subdomain, specify it instead of the standard address:
const fp = new StricteraFP(
"https://fp-check.example.com/fp/",
"<CUSTOMER-TOKEN>"
);
5. Optionally configure library behavior
|
The minimum recommendation is to enable |
When creating StricteraFP, you can pass a third argument: an options object. These options control how the library collects data and what it does if an API request fails.
const fp = new StricteraFP(
"https://fp.strictera.com/fp/",
"<CUSTOMER-TOKEN>",
{
prework: true,
maxRetries: 3,
fullScan: false
}
);
Three options are available:
| Option | What it does |
|---|---|
|
Starts some data-collection methods in advance, while |
|
Sets how many times an API request may be retried if the first attempt fails. |
|
Enables additional data-collection methods. For example:
You can request the full list of methods from our engineers. These methods can make the analysis more accurate but significantly slow down the library. They are disabled by default. If you want to enable them, agree on this with our engineers. |
6. Add library initialization
Add the initSP() call so the library receives configuration from the Strictera server:
await fp.initSP();
If you do not call initSP() explicitly, the library initializes when get() is called. A separate call makes the integration more predictable because you know when the library is ready.
7. Add data collection
Add the run() call so the library collects client environment parameters. Wait for it to complete with await before calling get():
await fp.run();
If you do not call run() explicitly, collection happens inside get().
|
Start collecting client environment data as early as possible, for example when the page opens. Send it to the DFP API at the moment of the target action, such as signing in, submitting a form, or confirming an operation. This gives you a faster DFP response and improves its accuracy. You configure sending data in step 10. |
8. Optionally pass additional context through customData
|
Pass additional DFP request parameters in the |
customData is an arbitrary string containing your data. DFP returns it unchanged in the payload as custom_data.
The customData string must not exceed 4,096 characters.
|
This string is not used to create fingerprints. It is only for your own service needs, so that you can configure business logic more easily. For example, you can pass an event type, form ID, scenario source, or any other context. This helps the backend understand which action the DFP result belongs to.
For example, the same user may open a sign-in page, submit a form, confirm a payment, or change a password. With customData, you link the DFP result to a specific event in your system.
Example of a dfpOptions object with customData:
const dfpOptions = {
customData: JSON.stringify({
event: "login_attempt",
form_id: "main_login"
})
};
Do not pass passwords, payment data, authentication tokens, or other secrets in customData.
9. Optionally pass customID
|
Use this field only after agreeing on it with our engineers. |
customID is a persistent identifier of a user, account, or another object in your system. It lets you link this object to its user_id on the Strictera side.
customID must not exceed 128 characters.
|
How Strictera uses this link depends on your scenario. Agree with our engineers on customID processing, rules to implement on the Strictera side, and how the result appears in the DFP response. This configuration is customized for each client.
To pass customID, add it to dfpOptions. If you use both customData and customID, pass both fields in the same object:
const dfpOptions = {
customData: JSON.stringify({
event: "login_attempt"
}),
customID: "account_12345"
};
10. Send collected data to DFP and get the result
To get a DFP result, add one of two get() calls:
-
If you created
dfpOptionsin the previous steps, pass it to the method:const result = await fp.get(dfpOptions); -
If you do not pass
customDataorcustomID, call the method without arguments:const result = await fp.get();
The method sends the collected data to Strictera. If processing succeeds, DFP returns a response with an encrypted payload.
If processing fails, DFP returns an unencrypted JSON response, for example { "error": "device data was not collected" }.
| Error | HTTP status | Description | ||
|---|---|---|---|---|
|
400 |
Fingerprint data is missing.
|
||
|
400 |
Request data was corrupted or modified in transit. |
||
|
400 |
Your service has an invalid DFP configuration. Contact support. |
||
|
400 |
DFP could not identify the service for the request. Contact support. |
||
|
400 |
The library could not collect the device and browser fingerprint, for example because of a blocker or browser restrictions. The user is not identified. |
||
|
400 |
Fingerprint data is corrupted or incorrectly formatted. |
||
|
400 |
Fingerprint data is incomplete and the user cannot be identified. |
||
|
400 |
|
||
|
400 |
|
||
|
409 |
For S2S integration only. A request with this |
||
|
500 |
An internal DFP error. Retry later. |
||
|
503 |
DFP could not process the request in time. Retry later. |
11. Send the DFP response to your backend
Send the DFP response to your backend. Payload decryption, result verification, and decision-making must take place there.
await fetch("/api/dfp/check", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(result)
});
12. Decrypt the payload on the backend
To decrypt it:
-
Decode
SECRET-KEYfrom Hex into binary data. -
Decode
iv,payload, andtagfrom Base64 into binary data. -
Decrypt
payloadwith AES-256-GCM, usingSECRET-KEY,iv, andtag. -
Interpret the decryption result as JSON.
Example of decryption in Node.js:
import * as crypto from "crypto";
const secretKey = Buffer.from("<SECRET-KEY>", "hex");
const iv = Buffer.from(input.iv, "base64");
const payload = Buffer.from(input.payload, "base64");
const tag = Buffer.from(input.tag, "base64");
const decipher = crypto.createDecipheriv(
"aes-256-gcm",
secretKey,
iv
);
decipher.setAuthTag(tag);
const decrypted = Buffer.concat([
decipher.update(payload),
decipher.final()
]);
const result = JSON.parse(decrypted.toString("utf8"));
Example of a decrypted payload:
{
"details": {
"antidetect": false,
"bot_hosting": false,
"bot_score": 0.1,
"engine": "gecko",
"hosting": false,
"incognito": false,
"isp_active_subnet": true,
"mobile": false,
"os": "linux",
"proxy_score": 0,
"proxy_signs": [],
"rdp": false,
"tor": false,
"vm": false,
"vpn": false,
"webview": false,
"new_user": false,
"confidence_score": 1
},
"custom_data": "{\"event\":\"login_attempt\",\"form_id\":\"main_login\"}",
"referer_md5": "9f0b84073da2ef97a63c2f4179981a2e",
"timestamp": 1777404974833,
"user_id": "3849965ed6d75d7dc67568d620950bbb",
"version": 2,
"white_bot": false
}
For details about every field, see What DFP Response Fields Mean.
|
If you receive |
13. Check result freshness
Your backend must compare timestamp with the current UTC time.
Do not accept responses that are more than a few seconds old. This protects your resource from replay attacks, where an attacker tries to pass an old DFP result as a new one.
If timestamp is fresh, processing can continue.
14. Process the data in your business logic
First check white_bot. If it is true, we recommend allowing the protected action automatically. Otherwise, check user_id, bot_score, proxy_score, proxy_signs, incognito, antidetect, vm, vpn, rdp, webview, tor, hosting, bot_hosting, isp_active_subnet, engine, os, mobile, new_user, confidence_score, and custom_data according to your business logic.
One possible rule detects suspicious sign-in attempts using user_id and bot_score. Your backend:
-
receives
user_idfrom the decrypted payload; -
checks whether this
user_idis linked to the user’s account in your database; -
follows the normal sign-in flow if the link exists and
bot_scoreis low; -
requests additional sign-in confirmation if
user_idis new andbot_scoreis medium or high; -
stores
user_id, the result of the additional check, and its link to the account for future sign-in attempts.
We have prepared guides for specific business scenarios:
15. Test the integration
After configuration, test the integration on your resource:
-
Open a page where the DFP library is connected.
-
Perform the action for which you configured a check, for example sign in, submit a form, or confirm an operation.
-
Make sure the browser received the DFP result and sent it to the backend.
-
Make sure the backend decrypted the payload, checked
timestamp, processed other response fields, and applied your rules.