Add the ALTCHA widget to your form and point challengeurl to this service.
<script async defer src="https://cdn.jsdelivr.net/gh/altcha-org/altcha@main/dist/altcha.min.js" type="module"></script>
<form action="/your-submit" method="POST">
<input name="email" placeholder="Email" />
<altcha-widget challengeurl="http://localhost:3000/challenge"></altcha-widget>
<button>Submit</button>
</form>On form submission, the altcha field value is included in the request body. Extract this value in your backend and send it to POST /verify for verification. The response code indicates the result:
202 Accepted→ Verification successful417 Expectation Failed→ Invalid or reused token
PowerShell:
# Assuming $payload contains the altcha value from the client
curl http://localhost:3000/verify -Method POST -Body @{altcha=$payload} -UseBasicParsingUnix/macOS:
curl -X POST \
-d "altcha=$payload" \
http://localhost:3000/verify -iTo customize the widget appearance, see Widget Customization.