Quickstart
Put FraudLens on a signup form: browser collects a session, your server scores it. About 10 minutes if the form already exists.
1. Create API keys
- Open Get API key and sign up with a work email for Live Network trial, or Free for email/IP only.
- Copy publishable
fk_pk_…(browser) and secretfk_sk_…(server). - Store the secret in env — never ship it to the client or commit it to git.
402 plan_upgrade_required.
2. Allow your website origin
Browser collect checks Origin. Register your front-end origin once:
curl -s https://fraudlens.io/v1/account/origins \
-X PUT \
-H "X-Api-Key: fk_sk_YOUR_SECRET" \
-H "Content-Type: application/json" \
-d '{ "origins": ["https://yourshop.com", "http://localhost:3000"] }'
3. Embed the browser SDK
Prefer same-origin /c.js (proxy our script) so adblockers are less likely to kill collect.
Fallback: load from fraudlens.io.
<!-- On your signup / login page -->
<script src="/c.js" async></script>
<script>
window.addEventListener("load", function () {
FX.auto({
publishableKey: "fk_pk_YOUR_PUBLISHABLE",
baseUrl: "", // same origin → /v1/x proxied to FraudLens
form: "#signup", // form selector
mode: "full", // all live pillars
progressive: true, // idle before heavy WebRTC
onReady: function (r) {
// r.session_id is written to hidden input name=frod_session_id
console.debug("FraudLens session", r.session_id);
}
});
});
</script>
What happens under the hood: create session → fire DNS canary → wait idle → WebRTC / path →
POST …/collect. On submit, if the session is still empty, the SDK finishes collect urgently.
Full options: Browser embed.
4. Score on your server
When the form posts, read frod_session_id and call assess with your secret key:
curl -s https://fraudlens.io/v1/assess \
-H "X-Api-Key: fk_sk_YOUR_SECRET" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"session_id": "ses_…",
"user_id": "usr_123",
"watch_mode": "new_only",
"context": { "flow": "signup" }
}'
Node example:
const res = await fetch("https://fraudlens.io/v1/assess", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Api-Key": process.env.FROD_SECRET_KEY,
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
email: req.body.email,
session_id: req.body.frod_session_id,
user_id: String(user.id),
watch_mode: "new_only",
context: { flow: "signup" },
}),
});
const data = await res.json();
// data.score, data.action, data.reasons, data.support
5. Act on the response
Create account / continue
OTP, 3DS, manual review
Reject quietly or with message
Use action for enforcement. If Shadow mode is on, action is forced to allow while
raw_action shows what you would have done — perfect for a tuning week.
6. Verify the integration
- DevTools → Network: session create, canary/pixel, collect all 2xx.
- Assess returns
ok: trueand anetworkblock when live plan is on. - Dashboard → recent assesses / stats look sane.
- Optional: set webhook and trigger a low-score test.