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.
HTML
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
- Widget Behavior: when visitors see a challenge and when verification starts.
- Hidden Mode: verify without a visible widget.
- Theming: colors and labels.
- Security: Content Security Policy settings.
Last updated on