## Quick Start

Add the script to a form, then send its tokens to Maskbreak from your server. Submit once in watch mode and look for the decision in Events. You’ll need a [free API key](https://maskbreak.com/signup).

Install an SDK or import the OpenAPI specification

Node.js SDK `npm install @sentinelsup/sdk` [npm ↗](https://www.npmjs.com/package/@sentinelsup/sdk) · [GitHub ↗](https://github.com/sentinelsup/maskbreak-node)

Python SDK `pip install sentinelsup` [PyPI ↗](https://pypi.org/project/sentinelsup/) · [GitHub ↗](https://github.com/sentinelsup)

PHP SDK `composer require sentinelsup/sdk` [Packagist ↗](https://packagist.org/packages/sentinelsup/sdk) · [GitHub ↗](https://github.com/sentinelsup/maskbreak-php)

OpenAPI 3.1 `https://maskbreak.com/openapi.json` [Spec ↗](https://maskbreak.com/openapi.json) ·

Use Maskbreak with an iOS or Android app

**Signup in a hosted web page.** Open your own HTTPS signup page in a browser from your app. Install the browser integration on that page. Your backend checks the submitted network token and device event, then acts on the decision before creating an account. [Read the signup integration guide](https://maskbreak.com/integrate.md).

**Signup in a native screen.** Your Swift or Kotlin app submits to your own signup endpoint. Your backend can call [GET /v1/lookup/{ip}](https://maskbreak.com/api#lookup) using the client IP from a trusted ingress and your server’s Maskbreak API key. This checks address reputation. A clean IP result leaves device identity, tampering and residential proxy status unverified.

Maskbreak’s published SDKs run on your server. Native device collection for iOS and Android needs a separate integration. Keep the secret API key off the phone.

Set up with a coding assistant

Set up with AI Claude Code · Cursor · Copilot · Windsurf

Using an AI coding assistant? Paste this prompt and it wires Maskbreak into your app end-to-end — frontend script, backend check, env var, and a test. It follows the machine-readable guide at [maskbreak.com/integrate.md](https://maskbreak.com/integrate.md).

`Fetch https://maskbreak.com/integrate.md and follow it to add Maskbreak fraud protection to this app — protect signup, login, and checkout. Start in watch mode (MASKBREAK_MODE). Read the API key from the server-only MASKBREAK_API_KEY environment variable; I will configure the secret separately. Never put it in client-side code. Then show me how to test it.`

Your Maskbreak API Endpoint

`https://maskbreak.com/v1/evaluate`

Your backend calls this URL. Your API key authenticates the request.

**Start in watch mode**

The example starts in watch mode: it sends every submission to Maskbreak, also one with a missing field (the dashboard then says which half did not arrive), logs the decision and lets every visitor continue. Once your dashboard Events look right, set `MASKBREAK_MODE=enforce` and redeploy: the same handler then stops `block` and holds `review`, missing evidence and errors. When the month's checks are used up (HTTP 429 with the code `monthly_quota_exceeded`), it lets the action through unchecked and logs it until the 1st, so running out never takes your form offline. The [integration guide](https://maskbreak.com/integrate.md) has the same handler and a Next.js App Router example.

View the complete HTML and server example

Integration pattern — keep your existing login handler

```
// STEP 1 — HTML. The script on the page with your form, the class on the form itself.
// Your site sends a Content-Security-Policy (helmet's default does)? Add Maskbreak's
// hosts first, or the browser blocks the script: maskbreak.com/integrate.md#content-security-policy
<script async src="https://maskbreak.com/assets/sentinel.js"></script>
<form class="monocle-enriched" id="login-form">
  <input type="email" name="email" required>
  <button type="submit">Continue</button>
</form>

// STEP 2 — Your frontend script. It never holds the form on Maskbreak:
// a blocked or missing script only means the check gets less evidence.
document.getElementById('login-form').addEventListener('submit', async (event) => {
  event.preventDefault();
  const evidence = window.Sentinel ? await window.Sentinel.collect() : {};
  const response = await fetch('/your-login-endpoint', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    // evidence = { token, fingerprintEventId, tz }, already the API's names
    body: JSON.stringify({ email: event.target.email.value, ...evidence })
  });
  // Handle response.status and the next step in your existing login UI.
});

// STEP 3 — Node 18+ / Express backend.
// express, app and existingLoginHandler belong to your application.
// This check is NOT authentication and never creates a login session.
// MASKBREAK_MODE unset or 'watch' (start here): send every submission, also one
// with a missing field (the dashboard then says which half did not arrive),
// log the answer and always continue. 'enforce': stop block; hold review,
// missing evidence and errors (a used-up month continues, logged).
const MASKBREAK_MODE = process.env.MASKBREAK_MODE || 'watch';
app.use(express.json({ limit: '16kb' }));
app.use(express.urlencoded({ extended: false, limit: '16kb' }));
app.post('/your-login-endpoint', async (req, res, next) => {
  const body = req.body || {};
  // Form fields -> API names: monocle -> token, sentinel_fp -> fingerprintEventId,
  // sentinel_tz -> tz. Sentinel.collect() already returns the API names.
  const token = body.token || body.monocle;
  const fingerprintEventId = body.fingerprintEventId || body.sentinel_fp;
  const tz = body.tz || body.sentinel_tz;
  const missing = typeof token !== 'string' || !token ||
    typeof fingerprintEventId !== 'string' || !fingerprintEventId;
  let result = null, hold = null, monthUsedUp = false, status = null;
  if (!missing || MASKBREAK_MODE !== 'enforce') {
    try {
      const response = await fetch('https://maskbreak.com/v1/evaluate', {
        method: 'POST',
        signal: AbortSignal.timeout(5000), // example budget; measure your own
        headers: {
          'Authorization': 'Bearer ' + process.env.MASKBREAK_API_KEY,
          'Content-Type': 'application/json'
        },
        body: JSON.stringify({ token, fingerprintEventId, tz, email: body.email })
      });
      status = response.status; // 401: MASKBREAK_API_KEY is empty or wrong
      if (!response.ok) {
        const refusal = await response.json().catch(() => null);
        // The month's checks are used up: apply the login route's quota fallback below.
        if (response.status === 429 && refusal?.code === 'monthly_quota_exceeded') monthUsedUp = true;
        else throw new Error('Visitor check unavailable');
      } else {
        result = await response.json();
        // Production gate: never authorize from a fixture or personal test key.
        if (!result || result.test || result.sandbox || result.sample ||
            !['allow', 'review', 'block'].includes(result.decision)) {
          throw new Error('No production verdict');
        }
        if (result.decision === 'block') {
          hold = [403, { error: 'Action refused by policy' }];
        } else if (result.decision === 'review' || result.degraded || !result.device) {
          hold = [409, { next: 'step_up' }]; // implement a real step-up flow
        }
      }
    } catch {
      // Example temporary hold. Choose a fallback for each business action.
      hold = [503, { error: 'Check unavailable; try again shortly' }];
    }
  }
  // Set MASKBREAK_QUOTA_VERIFY_ACTIONS=login to hold this login route on exhaustion.
  if (monthUsedUp && (process.env.MASKBREAK_QUOTA_VERIFY_ACTIONS || '').split(',').map(s => s.trim()).includes('login')) hold = [409, { next: 'step_up' }];
  if (missing) hold = [409, { next: 'step_up' }]; // enforce never trusts half a check
  // One line per check. Never log the key, browser tokens or form data.
  console.log('[maskbreak]', MASKBREAK_MODE, 'HTTP ' + (status ?? 'none'),
    result ? result.decision : monthUsedUp ? 'monthly_quota_exceeded' : 'no answer',
    hold ? 'enforce would return ' + hold[0] : 'enforce would continue');
  if (MASKBREAK_MODE === 'enforce' && hold) {
    return res.status(hold[0]).json(hold[1]); // never mint a session here
  }
  req.fraudCheck = result;
  return next(); // normal credential + authorization checks still run
}, existingLoginHandler);
```
