Skip to main content
The challenge widget silently measures a visitor, lets a clean one through with no friction, and steps a suspicious one into a physical device ceremony before allowing the action. Your backend confirms the result with a single server-side call. If you have wired Cloudflare Turnstile before, this is the same shape.

Add the widget

Load the script and drop a container into the form you want to guard.
The widget runs the probe, and on success writes a token into a hidden heretic-response field inside the form. When the visitor is contradicted, it presents the ceremony first — on a desktop it shows a rolling QR to continue on a phone; on a phone it runs the ritual inline — and writes the token once they pass.

Prove your domain

The site key is public, so the widget only serves pages on the domain the site is registered to, and only once you have proven you control that domain. In the dashboard, open the site, set its domain, and start verification. You get a token to publish in one of two places: Then press Check now. Either proof is enough. A verified site accepts its domain, the www. form, and any subdomain. Changing the domain restarts verification. Until a site is verified the widget reports site-unverified through data-error-callback and issues no token.

Configure

Attributes on the container, or options to heretic.render().

Explicit rendering

heretic.render(container, options) returns a widget id. Also available: heretic.getResponse(id), heretic.reset(id), heretic.remove(id), heretic.execute(id), heretic.isExpired(id).

Test keys

Build against the widget without a real site, a real device, or quota. These keys are reserved and never belong to a tenant. A real secret never accepts a test token, and the test secret never accepts a real one. To exercise the ceremony itself, use a real site key with data-mode="challenge".

Verify on your server

Never trust the token on the client. When the form arrives, exchange it:
Request parameters (JSON or application/x-www-form-urlencoded): Success response:
verdict is the probe’s finding; challenged says whether a ceremony ran; outcome is the ceremony result (passed) when it did. Check hostname against your own domain, exactly as you would with any siteverify. Failure response:

Notes

  • Tokens are single-use and valid for 5 minutes, like any challenge token.
  • The widget surface is budgeted: 60 calls a minute per visitor address, 1,200 decisions a minute per site across all addresses, and at most 500 ceremonies open per account at once. Over budget, the widget reports 429 through data-error-callback; a visitor who waits and retries is served. These are ceilings against floods, not quotas you will meet in ordinary use.
  • The site key is public and the widget endpoints are pinned to your site’s registered domain, so register the domain your form is served from.
  • The widget counts one probe per visitor and one challenge per ceremony against your plan. Read this month’s counts, limits, and overage at GET /v1/usage with your secret key. Sandbox stops at its limit: the sensor opens no more sessions for your sites and the widget reports 429 with quota-exceeded instead of minting a ceremony. Paid plans keep serving; the excess is overage at 0.0025perprobeand0.0025 per probe and 0.025 per challenge.