Docs menu
Start

Quickstart: screen your first sign-up

Four steps: create your keys, add the browser script to the sign-up page, check the result on your server, and act on the verdict. Use test keys while you build; they never count against your quota.

Last updated

Step 1: Create the keys

Create a free account, then open the console at Settings › Keys and create:

  • a test site key (bs_site_test_…) with the domain of your sign-up page in its list of domains. The site key is public: it goes in the page.
  • a test secret API key (bs_test_…). Keep it on your server, for example in the environment variable INLINESHIELD_API_KEY. Never put it in a page or an app.

When you go live, create live keys (bs_site_… and bs_live_…) the same way and swap them in. See Test mode.

Step 2: Add the browser script

Add this tag to the page with your sign-up form, with your site key:

HTML
<script src="https://api.inlineshield.io/inlineshield.js" data-sitekey="YOUR_SITE_KEY" async></script>

When the form is submitted, the script sends the email to POST /api/v1/check, puts the single-use token it gets back in a hidden field named betshield_token, and submits the form. JavaScript-submitted forms: include `form.betshield_token.value` in your request, or send `new FormData(form)`.

More detail: Browser script.

Step 3: Check the sign-up on your server

Before you create the account, send the token and the submitted email to POST /api/v1/siteverify with your secret key. These are the same snippets as the console's Setup page:

# $TOKEN is the betshield_token form field, $EMAIL the submitted email
curl -X POST https://api.inlineshield.io/api/v1/siteverify \
  -H "X-Api-Key: $INLINESHIELD_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"token\": \"$TOKEN\", \"email\": \"$EMAIL\"}"

# Switch on action: "allow" → create the account; "hold" → create it pending and store reviewId; "block" → reject the signup.
# A "hold" answer also carries a reviewId (rev_...): keep it, the signup is resolved later by a
# webhook (signup.approved / signup.rejected) or by GET https://api.inlineshield.io/api/v1/reviews/<reviewId>.

# If the answer is {"success": false, "error": "NO_TOKEN"} (script blocked, timed out or
# missing), judge the signup server-side instead, with the visitor's IP and User-Agent
# taken from YOUR incoming request, and switch on "action" the same way
# (strict mode, REQUIRE_INLINESHIELD_TOKEN = true in the other snippets, rejects instead):
curl -X POST https://api.inlineshield.io/api/v1/verify \
  -H "X-Api-Key: $INLINESHIELD_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"email\": \"$EMAIL\", \"ip\": \"$VISITOR_IP\", \"userAgent\": \"$VISITOR_UA\"}"

# HTTP 401 (bad API key) means reject. HTTP 402 {"error": "QUOTA_EXCEEDED", ...} means the
# account is over its monthly check limit: treat it like "InlineShield unavailable", exactly as
# for a timeout, 5xx, any other non-2xx answer, non-JSON, or a /verify answer with no
# "decision" field: accept the signup and log it (INLINESHIELD_FAIL_CLOSED = true in the other
# snippets rejects instead).

If error is "NO_TOKEN" (the script was blocked, timed out or is missing), the snippet judges the signup server-side with POST /api/v1/verify (email, visitor IP and User-Agent) and applies the same rule to its decision; set REQUIRE_INLINESHIELD_TOKEN = true to reject those signups instead. If InlineShield itself is unreachable, times out or errors, the snippet accepts the signup and logs a warning; set INLINESHIELD_FAIL_CLOSED = true to reject instead. While your account is over its monthly limit, signups arrive without a token and InlineShield answers QUOTA_EXCEEDED, which follows INLINESHIELD_FAIL_CLOSED even in strict mode.

To try it, sign up on your page with a magic address such as allow@test.inlineshield.io; with test keys it always gives the same answer. The full list is on Test mode.

Step 4: Handle the verdict

Switch on action: "allow" → create the account; "hold" → create it pending and store reviewId; "block" → reject the signup.

actionWhat to do
allowCreate the account.
holdCreate it pending (no login, no bonus) and store the reviewId. It is decided later in the console Review queue.
blockRefuse the sign-up.

Next to action, recommendedAction gives finer advice, for example allow_no_bonus for an allowed sign-up with a risk score of 25 or more. See Handling verdicts and Hold and review.

Ready for real traffic? Work through the going live checklist.