Your values Fill in your own to see them in every example
The host your form lives on, as you registered it under HumanProof → Sites.
That doesn’t look right yet. For example: www.example.com
Saved in this browser only, for every page of these docs. Nothing you type leaves this page.
HumanProof answers one question: is a person here right now? It never answers who. Use it where bots cost you money or trust (sign-ups, comments, free trials, text-message codes, downloads) without making real people solve puzzles. The visitor taps once and uses their passkey; a visitor with no passkey makes one in the same tap.
Quickstart
-
Register your site. In the hub, open HumanProof → Sites and add the host your form lives on, such as
www.example.com, and choose the level of proof its visitors give. HumanProof only vouches for the hosts you register. If your forms live on several subdomains, register the domain above them, such asexample.com, and choose Subdomains too: the DNS record that proves the domain covers every name under it. -
Add the script and mark the form. Load the script once, then add
data-humanproofto each form you want to protect. The widget appears above the submit button, and ahumanproof-tokenfield is sent with the form.<script src="https://id.trustaige.com/humanproof.js" defer></script> <form action="/signup" method="post" data-humanproof> <input name="email" type="email" required> <button type="submit">Create account</button> </form>Protecting something that isn’t a form, such as a download, a vote or a costly action? See without a form.
-
Check the token on your server. A check in the browser is one a bot can skip. Before you act, send the token and your site’s host to the verify endpoint, and act on
valid. Trustaige learns the token and the site, nothing about the person.app.post('/signup', async (req, res) => { const token = req.body['humanproof-token']; const check = await fetch('https://id.trustaige.com/humanproof/verify', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ origin: '<your-site-host>', token: token || '' }), }); const { valid } = await check.json(); if (!valid) return res.status(403).send('Prove you are human, then try again.'); await createAccount(req.body); });func handle(w http.ResponseWriter, r *http.Request) { token := r.FormValue("humanproof-token") body, _ := json.Marshal(map[string]string{"origin": "<your-site-host>", "token": token}) resp, err := http.Post("https://id.trustaige.com/humanproof/verify", "application/json", bytes.NewReader(body)) if err != nil { http.Error(w, "try again", http.StatusServiceUnavailable) return } defer resp.Body.Close() var v struct{ Valid bool } json.NewDecoder(resp.Body).Decode(&v) if !v.Valid { http.Error(w, "Prove you are human, then try again.", http.StatusForbidden) return } createAccount(w, r) }@app.post("/signup") def handle(): token = request.form.get("humanproof-token") check = requests.post("https://id.trustaige.com/humanproof/verify", json={"origin": "<your-site-host>", "token": token or ""}, timeout=5) if not check.json()["valid"]: abort(403, "Prove you are human, then try again.") return create_account(request.form)curl https://id.trustaige.com/humanproof/verify \ -H 'Content-Type: application/json' \ -d '{"origin":"<your-site-host>","token":"<humanproof-token>"}'A request without a token is refused, the same as one whose token fails. A bot that skips the widget gets the same answer as a bot that fails it: that is what makes it a check.
Act on the answer
| Answer | Means | Do |
|---|---|---|
valid: true | A person proved it, for this site. | Go ahead. |
spent | This token was already used. | Refuse: a token works once. |
below_site_policy | Real, but a lower level than this site asks for. | Refuse, and ask them to prove again. |
invalid | Not a token HumanProof issued for this site. | Refuse. |
origin_not_enabled | This site isn’t registered. | Register it under HumanProof → Sites. |
When valid is true, tier says how presence was shown: prove,
prove_plus or attested (see levels). Every field and
status is in the verify reference.
Verify without calling Trustaige
Prefer not to call the verify endpoint? Tokens also verify offline against the
public keys published at
https://id.trustaige.com/.well-known/private-token-issuer-directory, using
Privacy Pass (RFC 9578).
Next
- Without a form: downloads, votes and costly actions, and single-page apps.
- Levels of proof: Prove, Prove+ and Attested, and which to ask for.
- Use cases: where HumanProof pays off, with the level to ask for in each.