In Google’s official documentation, reCAPTCHA v3 is demonstrated using plain JavaScript.
However, implementing it in frameworks like React requires a slightly different approach.
This project aims to apply Google reCAPTCHA v3 in the simplest possible way,
without using any third-party packages. While third-party packages can make integration easier,
they also introduce risks if the package contains bugs or malicious code.
For that reason, it’s safer to rely directly on Google’s own script.
- No third-party packages — depend only on Google’s official script.
- Simple and framework-agnostic — works with any React setup.
- Reusable hook — reCAPTCHA loads only on specific pages, not globally.
- Live demo: reCAPTCHA v3 demo
- reCAPTCHA hook:
use-recaptcha.hook.ts - Enterprise version:
use-recaptcha-enterprise.hook.ts - Example page using reCAPTCHA:
page.tsx