Dev.to Security πŸ” Cybersecurity πŸ‘ 0 πŸ“– 3 min read

Integrate a fraud-risk API in five minutes (with a script tag and one POST)

Signet is a hosted device-intelligence API. You add one script tag, send a session ID from your server, and get back a fraud decision, a score, and a short explanation. This walk-through gets you from zero to a working a

Signet is a hosted device-intelligence API. You add one script tag, send a session ID from your server, and get back a fraud decision, a score, and a short explanation. This walk-through gets you from zero to a working allow / review / deny result in about five minutes.

The live demo (no account) is here: https://signetsentry.com/demo. The full guide is at https://signetsentry.com/guide.

1. Get keys (about one minute)

Create a free account at https://signetsentry.com/signup. No card is required. You get:

  • a public site key (pk_live_...) for the browser
  • a secret API key (sk_live_...) for your server (shown once)
  • sandbox keys (pk_test_... / sk_test_...) that use no quota and store nothing

Use the sandbox keys while you are wiring this up.

2. Add the tag

Put this on the pages where you care about risk (login, signup, checkout). Replace the site key.

<script async src="https://signetsentry.com/v1/tag.js" data-site-key="pk_test_..."></script>

The tag profiles the browser in the background (device and browser attributes, a few behaviour counts β€” it does not read what is typed) and asks Signet for a session ID.

If you have a form, mark it:

<form data-signet method="post" action="/pay">
  <!-- your fields -->
  <button type="submit">Pay</button>
</form>

The tag inserts a hidden signet_session_id field, including on forms your framework adds later.

3. Ask for a decision

On the server, read signet_session_id and call POST /v1/assess. Keep the secret key off the client.

curl -s https://signetsentry.com/v1/assess \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{"session_id":"s_...","event":"checkout"}'

A trimmed response looks like this:

{
  "decision": "review",
  "risk_score": 60,
  "summary": "Review: a device on a scored network.",
  "reason_codes": ["IP_DATACENTER"],
  "visitor": {
    "is_new": false,
    "match_type": "fuzzy",
    "match_confidence": 0.94
  }
}

decision is allow, review, or deny. You choose the action (for example: allow, step up with 2FA, or block). match_confidence is a 0–1 score on the device match, not a yes/no, so you can set your own threshold.

While you are still in the sandbox, you can skip a real browser entirely and use the magic session IDs test_allow, test_review, and test_deny.

4. Optional: wait for a cookie banner

If you must have consent before any device signals leave the browser:

<script async src="https://signetsentry.com/v1/tag.js"
        data-site-key="pk_test_..."
        data-consent="required"
        data-respect-gpc="true"></script>

Nothing is collected or stored until your banner calls Signet.consent(true). Signet.consent(false) stops collection and clears the stored token. data-respect-gpc="true" treats a Global Privacy Control signal as a refusal.

This is a hook, not legal advice. You still need a lawful basis and a notice that fits your jurisdiction. Signet publishes a privacy policy and a DPA at https://signetsentry.com/privacy and https://signetsentry.com/dpa.

5. Go live

Switch pk_test_ / sk_test_ to pk_live_ / sk_live_ when you are ready. The free plan includes 1,000 live assessments a month. Quota applies only to successful assessments, not to collecting a session, and not to sandbox keys.

If you want more detail β€” scoring profiles, webhooks, reason codes, or language-specific examples β€” the developer guide is the next stop: https://signetsentry.com/guide.

Signet is built by Main Street Playbooks for fraud prevention, not advertising.

πŸ“° Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.