reCAPTCHA is a PHP client library that wraps the server-side verification step for Google's reCAPTCHA service, protecting websites from spam and abuse.
The library solves the problem of validating reCAPTCHA responses on the server side. After a user completes a reCAPTCHA challenge on your frontend, the service returns a response token. This library takes that token along with your secret key and verifies it against Google's servers, confirming the user passed the challenge legitimately. It supports both reCAPTCHA v2 and v3, each with different validation approaches.
Developers integrating reCAPTCHA into PHP applications should use this library for server-side verification. It suits any PHP project needing bot protection, from traditional web applications to mobile backends. The library provides methods to enforce additional validation rules: hostname verification for web applications, APK package name verification for Android apps, action matching for v3, score thresholds for v3's risk-based approach, and challenge timeout enforcement. These can be chained together for flexible configuration. For reCAPTCHA Enterprise deployments, Google provides a separate client library.
The project maintains active support for modern PHP versions, having moved to PHP 8 and above while keeping earlier releases available for legacy environments. Installation is straightforward through Composer or direct download, with PSR-4 compliant class structure. The library is installable via Packagist and includes an autoloader for manual integration.