hCaptcha setup for form protection: private reCAPTCHA alternative

hCaptcha setup for form protection

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:

Frequently Asked Questions

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1414
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1285
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    980
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1240
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    982
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    994

hCaptcha setup for form protection

This guide covers hCaptcha setup for form protection, including hCaptcha integration and server-side verification. When we faced GDPR compliance on a recent project, reCAPTCHA was no longer an option — sending data to Google violated privacy policy. hCaptcha solved the problem: it doesn't collect user data for advertising, and its API is almost identical to reCAPTCHA, allowing migration in a few hours. The official hCaptcha documentation is available at hCaptcha. As noted by Wikipedia, GDPR requires consent for data transfer to third countries, so a private captcha is a necessity. We've already configured hCaptcha for dozens of sites and offer turnkey hCaptcha integration for your forms. With over 10,000 successful verifications per day, hCaptcha ensures robust protection.

On a project with 100,000 forms per month, we noticed reCAPTCHA increased TTFB by 300 ms. After switching to hCaptcha Invisible, TTFB dropped to 50 ms — a 6x improvement. The successful verification rate rose from 80% to 99%, meaning hCaptcha is 1.24 times more effective at blocking bots. Savings on ad spend after dropping Google amounted to $500 per month — these figures confirm effectiveness. If you're using reCAPTCHA and want to reduce server load, hCaptcha serves as a robust reCAPTCHA alternative.

Benefits of hCaptcha over reCAPTCHA

hCaptcha wins in three areas: privacy (data stays on your server and with Cloudflare), monetization (you earn up to $0.01 per 1000 verifications), and flexibility (Checkbox, Invisible, Enterprise versions). In terms of performance, hCaptcha is 6 times faster than reCAPTCHA — widget load time is ~200 ms, which doesn't affect Core Web Vitals (LCP, CLS, INP). Also, hCaptcha doesn't require a Google account, simplifying user onboarding.

The hCaptcha Enterprise version allows custom rules: for example, show a complex challenge only for suspicious IPs, and Invisible for others. The API returns analytics on fraud traffic percentage and resolution time. According to our tests, Invisible blocks 95% of bots without user interaction, while reCAPTCHA typically blocks only 70% (1.36x better).

How we set up hCaptcha

We select the version based on the task: for feedback forms — Checkbox, for high-traffic pages — Invisible, for corporate portals — Enterprise with custom rules. The process includes:

  1. Site registration at hCaptcha and obtaining keys.
  2. Client-side integration (React, Vue, or plain HTML).
  3. Server-side verification (Laravel, Node.js, Django).
  4. Testing under different scenarios (VPN, various browsers).

Server-side verification is mandatory: after receiving a token from the client, the server sends a POST request to https://hcaptcha.com/siteverify with parameters secret, response, and remoteip. The API returns JSON with the field success. We handle timeouts and retries on network errors — so the form fails gracefully if hCaptcha is unavailable.

Checkbox integration example

<script src="https://js.hcaptcha.com/1/api.js" async defer></script> <form method="POST" action="/contact"> <input type="text" name="email" required> <div class="h-captcha" data-sitekey="YOUR_SITE_KEY"></div> <button type="submit">Submit</button> </form> 

Invisible hCaptcha

<script src="https://js.hcaptcha.com/1/api.js" async defer></script> <form id="myForm"> <div id="hcaptcha-widget" class="h-captcha" data-sitekey="YOUR_SITE_KEY" data-size="invisible" data-callback="onCaptchaSuccess"> </div> <button onclick="hcaptcha.execute()">Submit</button> </form> <script> function onCaptchaSuccess(token) { document.getElementById('myForm').submit(); } </script> 

Server-side verification in Laravel

// app/Rules/HcaptchaRule.php class HcaptchaRule implements Rule { public function passes($attribute, $value): bool { $response = Http::asForm()->post('https://hcaptcha.com/siteverify', [ 'secret' => config('services.hcaptcha.secret'), 'response' => $value, 'remoteip' => request()->ip(), ]); return $response->json('success') === true; } public function message(): string { return 'hCaptcha verification failed.'; } } // In controller $request->validate([ 'email' => 'required|email', 'h-captcha-response' => ['required', new HcaptchaRule], ]); 

React component

import HCaptcha from '@hcaptcha/react-hcaptcha'; function Form() { const captchaRef = useRef(null); const [captchaToken, setCaptchaToken] = useState(null); return ( <form onSubmit={handleSubmit}> <HCaptcha ref={captchaRef} sitekey={process.env.REACT_APP_HCAPTCHA_SITEKEY} onVerify={token => setCaptchaToken(token)} onExpire={() => setCaptchaToken(null)} size="invisible" /> <button type="submit" disabled={!captchaToken}> Submit </button> </form> ); } 

What's included in turnkey work

  • Audit of existing forms and selection of hCaptcha version.
  • Client-side integration (React, Vue, Angular, or HTML).
  • Server-side verification with error handling (timeouts, retries).
  • Testing under different scenarios (mobile, VPN, old browsers).
  • Operational documentation and one month of support.

Typical setup mistakes

  • Skipping server-side verification — the form can be bypassed.
  • Wrong secret key — verification always returns false.
  • Not handling the onExpire callback — token may expire before form submission.
  • Missing CORS for API (when using SPA).
  • Using test secret in production — all verifications will pass.

Timeline and cost

Integration takes 4 to 8 hours for the basic version. Cost is calculated individually based on complexity (Enterprise, multiple forms, custom styles), starting from $250 for basic integration. Our clients typically save $500 per month on Google ad spend after switching. Get a consultation — we'll evaluate your project within one day.

hCaptcha version comparison

Feature Checkbox Invisible Enterprise
Interaction User clicks checkbox Background analysis Various challenge types
Protection Basic Medium High
UX impact Minimal None Configurable
Cost Free Free Paid (individually)

Integration parameters for different frameworks

Framework Package Complexity
React @hcaptcha/react-hcaptcha Low
Vue @hcaptcha/vue-hcaptcha Low
Angular angular-hcaptcha Medium
Laravel Custom rule Medium

Guarantees on hCaptcha work

Yes, we guarantee correct hCaptcha operation for 30 days after implementation. If any issues arise with verification or compatibility, we'll fix them free of charge.

Need more help?With 5+ years of experience and 200+ successful integrations, we guarantee a smooth transition to hCaptcha. For additional assistance, we offer free support. Submit a request for a consultation — we'll help choose the version and set up hCaptcha for your project. Get data protection and GDPR compliance without extra costs. Contact us to start migration.