Skip to Content
Getting Started2. Add the Widget

2. Add the Widget

The widget verifies the visitor and adds a response token to your form. Your server checks this token in the next step.

Load the CaptchaFox script and add an element with the class captchafox where the widget should appear. Set data-sitekey to your sitekey from step 1.

<html> <head> <title>CaptchaFox Demo</title> <script async defer src="https://cdn.captchafox.com/api.js"></script> </head> <body> <form action="YOUR_SERVER_ENDPOINT" method="POST"> <input type="text" name="email" placeholder="Email" /> <input type="password" name="password" placeholder="Password" /> <div class="captchafox" data-sitekey="YOUR_SITEKEY"></div> <button type="submit">Submit</button> </form> </body> </html>

The token is sent with the form as the hidden field cf-captcha-response. If you submit the form with JavaScript, read it with captchafox.getResponse() and add it to your request.

Optional settings

Last updated on