Docs / You own the switch

You own the switch

FraudLens is not a magic “Block” button on your landing page. We return a recommendation (allow / challenge / block). Your backend (and UX) decide what actually happens.

Yes — the merchant builds the button Trust & safety / risk (or a small-SaaS CTO) integrates once: hang collect, call assess with user_id, then map action to their own flows (proceed, MFA/3DS, deny). We do not take over checkout UI. Optional helpers only suggest friction.

Who this is for

The buyer is usually trust & safety / risk (sometimes the CTO at a small SaaS). They already think in allow / step-up / deny. FraudLens gives them a live session score and reason codes so they can defend the call in review — not a marketing widget.

Why pilots stall — and how to unstick

Risk already knows allow / MFA / deny. Engineering must hang /c.js, set origins, pass your user_id, and branch on action. If one person is expected to own both without a split checklist, the pilot hangs.

OwnerOwnsDone when
Risk / T&S Which flow (signup/login), Shadow vs enforce, map action → MFA/deny, read disagree rows Shadow compare activated; week-2 CSV reviewed
Backend eng Origins, hang page+form, assess with stable user_id, optional peer_action Hidden frod_session_id fills; assess returns request_id in logs
Small SaaS CTO Both hats — use the same split as a personal checklist, don’t invent a bigger project One flow live in Shadow in an afternoon
Default pilot shape Day 0: keys + POST /v1/account/shadow-compare/activate. Day 1: eng hangs one form. Days 2–14: Shadow only — your current AF still decides UX. Then risk flips one flow to enforce. Do not start by redesigning checkout.

Recommended map (you still enforce)

actionTypical UXNotes
allow Proceed Create session / capture payment / activate trial
challenge Step-up MFA, 3DS, email/SMS code, manual review queue. Optional browser UI: Frod.challenge
block Deny or hold Store assess.support for CS; do not show raw reason codes to the end user

Tune bands and pillar weights in the cabinet / API when defaults don’t fit. Run shadow first. What to trust in a score: How scoring works.

Integration cookbook

  1. Keys: fk_pk_… browser · fk_sk_… server only.
  2. PUT /v1/account/origins with your shop origin(s).
  3. Hang collect (recommended hang: "page" + form):
<script src="/c.js" async></script>
<script>
  FX.auto({
    publishableKey: "fk_pk_…",
    hang: "page",
    form: "#signup"
  });
</script>
  1. After auth succeeds on your server, assess with your user_id:
// Node — npm i fraudlens-js
import { Frod } from "fraudlens-js";
const frod = new Frod({ secretKey: process.env.FROD_SECRET_KEY });

app.post("/signup", async (req, res) => {
  const user = await createUser(req.body); // your DB — get stable id first when possible
  const assessed = await frod.assess({
    email: req.body.email,
    session_id: req.body.frod_session_id,
    user_id: String(user.id),           // YOUR id — required for dossier / light credits
    context: { flow: "signup" },        // watch_mode auto → new_only
  }, { idempotencyKey: req.id });

  // You own the switch:
  if (assessed.action === "block") {
    await flagForReview(user.id, assessed.support);
    return res.status(403).json({ ok: false, support: assessed.support });
  }
  if (assessed.action === "challenge") {
    await requireMfa(user.id);
    return res.status(401).json({ ok: false, mfa: true, request_id: assessed.request_id });
  }
  return res.json({ ok: true, user });
});

Login / checkout / payout: same pattern with context.flow: "login" (or checkout/payout) so watch mode becomes continuous, and pass the same user_id as signup.

Why user_id matters Without it every assess is deep (1 credit) and no dossier freezes — ATO memory cannot work. FraudLens never invents an end-user id.

Optional helpers (still non-binding)

  • Browser: Frod.suggestFriction(assess.action) → { friction, hint, enforce: false }
  • Browser: Frod.challenge({…}) — captcha UI glue when you choose step-up
  • Server SDK: Frod.suggestFriction · Frod.watchModeForFlow
  • CS: support card from assess.support
const tip = Frod.suggestFriction("challenge");
// tip.friction === "step_up" — you still call your MFA / 3DS

Embed guide: Integrate · Hang styles: Placement · Response fields: Assess response.