Embed & integrate

Progressive browser collect · one profile per user · new_only / continuous · open verification checklist.

Two audiences, one product Shop / SaaS: follow steps below and ship today. Security team: read why live stack beats IP history — DNS hijacks for speed, path RTT, continuous ATO.
Full stack, IPQS-like feel Default mode: "full" progressive — features stay. First-party /c.js + /v1/x for adblock. Mobile/CGNAT soft scoring. Read pitfalls · speed.

1. Product model

1 client user = 1 Frod profile under your account. You pass a stable user_id on every /v1/assess. We build a dossier (IP, ASN, country/region, timezone baseline) and, depending on watch mode, either stop deep re-checks or keep history for account-takeover signals.

Quiet by design The browser SDK does not dump WebRTC + RTT on first paint. Session + canary start light; heavy signals wait for idle or first interaction so the visitor never feels a “check tax.”

2. Progressive browser embed

Publishable key only in the browser. Never call /v1/assess from the client.

<!-- Best: same-origin /c.js (proxy api). Fallback: CDN -->
<script src="/c.js" async></script>
<script>
  FX.auto({
    publishableKey: "fk_pk_…",
    baseUrl: "",                       // same origin — adblock-resistant
    form: "#signup",
    mode: "full",                      // default — all pillars
    progressive: true,                 // idle before WebRTC
    onReady: function (r) {
      // r.session_id → hidden field frod_session_id
    }
  });
</script>

Phases

  1. 1 Create session + canary 1×1 gif (cheap)
  2. 2 Wait requestIdleCallback / first gesture
  3. 3 WebRTC ICE candidates
  4. 4 Health RTT probe
  5. 5 POST …/collect → ready session_id

On submit, if the field is empty, Frod finishes collect with idleMs: 0 then continues the form — still progressive, just urgent.

Manual API:

const { session_id } = await Frod.collect({
  publishableKey: "fk_pk_…",
  progressive: true,
  idleMs: 1800,
  onPhase: (name) => console.debug("frod", name)
});

Allow your origin: PUT /v1/account/origins with the secret key.

3. Watch modes

Account default via PUT /v1/account/watch-mode. Per-request override: watch_mode on assess.

ModeWho is checked deeplyHistory / ATO
new_only Recent signups (new_user_days, default 14) and anyone without a complete dossier Dossier once. After complete + outside window → lightweight trust pass (skip_deep)
continuous Every assess with signals Full event history. IP churn, ASN flip, geo/ZIP jump, sudden fail → ATO suspicion
curl -X PUT https://api.fraudlens.io/v1/account/watch-mode \
  -H "X-Api-Key: fk_sk_…" \
  -H "Content-Type: application/json" \
  -d '{"mode":"continuous","new_user_days":14}'

new_only fits signup-heavy products that only need a first clean dossier. continuous fits login / session / payout risk where a clean user can later be hijacked.

4. Profiles & account takeover

Pass the same user_id every time. Optional registered_at (unix seconds or ISO) helps new_only age correctly.

ATO triggers (continuous)

Response includes profile.ato_suspicion, profile.flags, and bump into score / action.

GET /v1/profiles/{user_id}
X-Api-Key: fk_sk_…

Returns baseline + recent events (IP, ASN, country, score, action, flags).

5. Server assess

POST /v1/assess
X-Api-Key: fk_sk_…
Idempotency-Key: <uuid>
Content-Type: application/json

{
  "email": "user@example.com",
  "session_id": "ses_…",
  "user_id": "usr_123",
  "registered_at": "2026-11-01T12:00:00Z",
  "watch_mode": "continuous",
  "policy": "balanced",
  "context": { "timezone": "America/New_York" }
}

Shape of success:

{
  "ok": true,
  "score": 0-100,
  "action": "allow|challenge|block",
  "reasons": […],
  "profile": {
    "watch_mode": "continuous",
    "dossier": "complete",
    "ato_suspicion": false,
    "flags": [],
    "skip_deep": false
  },
  "email": {…},
  "network": {…}
}
Shadow mode PUT /v1/account/shadow {"enabled":true} keeps scoring but forces action: allow while exposing raw_action — use while tuning without user friction.

6. Verification checklist

  1. Create keys at Get started; store fk_sk_ server-side only.
  2. Whitelist origin · load /assets/frod.js · confirm hidden frod_session_id fills after idle (DevTools Network: sessions → canary → collect).
  3. Confirm first paint has no long WebRTC main-thread block (Performance: work after idle).
  4. Server: assess with session_id + user_id; expect profile.dossier building → complete.
  5. new_only: second assess after dossier + past window → skip_deep: true, new_only_trusted.
  6. continuous: change IP/ASN in test → ato_* reasons and score bump; GET /v1/profiles/… shows history.
  7. Optional: webhook assess.completed, shadow mode week, then enforce.

7. Language & platform guides

API docs · Swagger · Postman