hCaptcha
hCaptcha is the privacy friendly alternative to Google reCaptcha. Used by Cloudflare, Shopify & more..
Last updated
hCaptcha is the privacy friendly alternative to Google reCaptcha. Used by Cloudflare, Shopify & more..
Last updated
Web3Forms provides zero-config integration with hCaptcha. You don't need to setup your own keys or register with them. Just use the following code and add a script. You're done.
Remember hCaptcha's captcha mostly feels a bit difficult for users to solve. In that case, you can either use hCaptcha Paid Plan or use alternatives like hidden honeypot (less secure) or reCaptcha / Cloudflare Turnstile Captcha method (Pro).
Step 1: Add a <div> inside your form
Step 2: Add the script before the closing of </body>
You can provide all options provided by hCaptcha by default. You need to append the option with data-*
attribute. See example below
For more configuration options, visit: https://docs.hcaptcha.com/configuration
Once everything's setup you need to activate hcaptcha on your form to make it mandatory on each form submissions. For that, submit the form by checking the checkbox once and send the form. Now your hcaptcha will be activated.
Add Client Side Validation as shown below to prevent form submission without checking the hCaptcha field.
Use this snippet if you are using the HTML form-embedded method without Javascript to check whether the hCaptcha is filled or not.
Add this code block just above the closing of </body> and make sure YOUR_FORM_ID
is updated with your form id.
If you want to load hCoptcha directly instead of using web3forms proxy, make sure you use the following sitekey for free plans. You can set your own site key and secret key on all paid plans,
If you add just two lines to your contact form, you will get a working hCaptcha to protect your form.
To use hCaptcha with React or Next.js, please follow the instructions below.
First, install the @hcaptcha/react-hcaptcha package from NPM.
Then, add the <HCaptcha/> component inside the form.
Make sure you are using 50b2fe65-b00b-4b9e-ad62-3ba471098be2
as the sitekey
for free plans. Also make sure reCaptchaCompat
is false.
You can use a custom site key if you are on a Paid plan.
That's it.
Make sure you have enabled hcaptcha
as the Block Spam option in the settings. Login to your dashboard to change it if not enabled already.
You can see the following guide for more examples. Just make sure you are using the correct sitekey
as mentioned above.
https://www.npmjs.com/package/@hcaptcha/react-hcaptcha