Swoop Check: a free human check for forms
Free, mostly invisible, no puzzles.
Swoop Check tells your server that a form was sent by a person, without a puzzle. The visitor's browser does a small piece of maths in the background (a proof of work in the open ALTCHA format) and your server asks us whether the answer is right. Most people never notice it. It is free.
Install in three steps#
- Make a site key in the app, under Swoop Check. You get a public swc_pk_... key for the page and a secret swc_sk_... key for your server (shown once). List your hostnames so no other site can use your key.
- Put the box in your form and load the script once per page. The form gets a hidden field named swoop-check.
- On your server, send that field and your secret to the verify call before you accept the form.
<form action="/signup" method="post">
<input name="email" type="email" required>
<div class="swoop-check" data-sitekey="swc_pk_YOUR_SITE_KEY"></div>
<button>Sign up</button>
</form>
<script src="https://swoopads.xyz/c.js" async defer></script>The script starts the check when someone first touches the form, so it is usually finished before they press the button. If it is not, the form waits a moment and sends itself when the check is done.
Try it without an account#
These test keys work on any hostname, always pass with the lightest work and answer "test": true. Never use them on a live site: anyone can use them.
| Key | Value |
|---|---|
| Site key | swc_pk_test_0000000000000000 |
| Secret | swc_sk_test_0000000000000000000000000000 |
Options#
| Attribute | What it does |
|---|---|
| data-sitekey | Your public site key. Required. |
| data-start | auto (default: when the form is first touched), load (at once) or manual (only when your code calls SwoopCheck.execute). |
| data-theme | auto (follows the visitor’s light or dark setting), light or dark. |
| data-lang | en, es, pt, fr or de. Default: the page’s language, then the browser’s. |
| data-field | Name of the hidden field. Default swoop-check. |
| data-callback | Name of a global function that gets the token when the check is done. |
Pin a version#
/c.js is always the latest 1.x. To pin this exact build, use the versioned file with its integrity hash:
<script src="https://swoopads.xyz/c/1.0.0.js" integrity="sha384-ABgMQ1hqqgf1pCKdHxTSGk8F6FH0PmwOlGwkZ8tMVmjQMxTIzmS3RLXPFNZGNKNr" crossorigin="anonymous" async defer></script>JavaScript and ES modules#
For forms you send yourself (fetch, React, Vue), render the box and ask for the token when you need it:
import { render, execute } from 'https://swoopads.xyz/c/1.0.0.mjs'
const box = document.querySelector('#check')
render(box, { sitekey: 'swc_pk_YOUR_SITE_KEY', start: 'manual' })
form.addEventListener('submit', async (e) => {
e.preventDefault()
const token = await execute(box) // runs the check if it has not run yet
await fetch('/signup', { method: 'POST', body: new URLSearchParams({ email: form.email.value, 'swoop-check': token }) })
})window.SwoopCheck has the same functions: render(el, options), execute(el) (a promise of the token), reset(el) and scan(root). The box sends swoop-check:solved and swoop-check:error events.
What visitors see#
One small line under the form: Protected by Swoop · ads that pay creators, which links to swoopads.xyz/check. While a slower check runs it may also show one short Swoop Ads line. Swoop Check never shows ads from other companies.
WordPress and Shopify#
The Swoop Ads WordPress plugin adds Swoop Check to comments, sign-in, registration and lost-password forms with a site key and a secret in its settings. For Shopify see Shopify.
Next: verify on your server, privacy, limits.