---
title: "Antifraud Module"
url: "https://developer.incode.com/sdk-reference/web-sdk-2-module-antifraud/"
section: "sdk-reference"
group: "Incode Web SDK 2 Reference / Web SDK 2 Individual Modules"
version: "v1.1"
status: "live"
---
# Antifraud Module

:::note
This guide is specific to Web SDK 2.0. If you are still using 1.x, you can find documentation [here](/sdk-reference/web-sdk-reference).  Contact your Incode Representative for upgrade information and check if you are a candidate for this upgrade. <br /><br />Full rollout to all clients still TBD.
:::

The Antifraud module collects device, browser, and behavioral signals in the background and submits them to Incode's antifraud engine. Fire-and-forget — completes regardless of API outcome so the verification flow is never blocked.

> Follows the [backend-process pattern](/sdk-reference/web-sdk-2-module-patterns/#3-backend-process-modules). See the patterns page for the shared lifecycle.

## Tag

`<incode-antifraud>` is a standard Web Component. Importing the UI subpath registers the custom element.

```ts
import '@incodetech/web/antifraud';
import '@incodetech/web/antifraud/styles.css';
```

The component is essentially invisible — it runs the check and emits `onFinish`. You can mount it during transitions while showing your own loading UI.

## Properties

| Property   | Type                      | Required | Description                                                           |
| ---------- | ------------------------- | -------- | --------------------------------------------------------------------- |
| `config`   | `AntifraudConfig`         | ❌       | No options — type is `Record<string, never>`                          |
| `onFinish` | `() => void`              | ❌       | Called when the check completes                                       |
| `onError`  | `(error: string) => void` | ❌       | Called on a fatal error (rare — module swallows API errors by design) |

## Configuration

The module takes no configuration:

```typescript
type AntifraudConfig = Record<string, never>;
```

## State machine

`AntifraudState` is minimal — a discriminated union over `status`:

| Status       | Description                                           |
| ------------ | ----------------------------------------------------- |
| `idle`       | Initial state.                                        |
| `processing` | Collecting signals and submitting to the backend.     |
| `finished`   | Terminal — check is done (success or silent failure). |

## See also

- [Module Patterns → backend-process](/sdk-reference/web-sdk-2-module-patterns/#3-backend-process-modules)
- [Individual Modules](/sdk-reference/web-sdk-2-individual-modules/)