PHPackages                             enunez/grecaptcha-validator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. enunez/grecaptcha-validator

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

enunez/grecaptcha-validator
===========================

Google recaptcha validator

v1.0.3(3y ago)04MITPHPPHP ^8.1

Since Apr 10Pushed 3y ago1 watchersCompare

[ Source](https://github.com/enunezblanco/grecaptcha-validator)[ Packagist](https://packagist.org/packages/enunez/grecaptcha-validator)[ RSS](/packages/enunez-grecaptcha-validator/feed)WikiDiscussions main Synced yesterday

READMEChangelog (2)Dependencies (2)Versions (5)Used By (0)

Google's reCAPTCHA validator
============================

[](#googles-recaptcha-validator)

[![Build Status](https://github.com/enunezblanco/grecaptcha-validator/workflows/tests/badge.svg)](https://github.com/enunezblanco/grecaptcha-validator/actions)[![Packagist License](https://camo.githubusercontent.com/1e1c206961c1ef68d3fa7788422ab20d09d674c593aa3d2976b366a35d432f90/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f656e756e657a2f677265636170746368612d76616c696461746f72)](https://camo.githubusercontent.com/1e1c206961c1ef68d3fa7788422ab20d09d674c593aa3d2976b366a35d432f90/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f656e756e657a2f677265636170746368612d76616c696461746f72)[![Packagist Version (including pre-releases)](https://camo.githubusercontent.com/67d2fa06e6343a6fd2fe84b2f5bba224145d9fe020e5174a82d10f0dd3765adf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656e756e657a2f677265636170746368612d76616c696461746f723f696e636c7564655f70726572656c6561736573)](https://camo.githubusercontent.com/67d2fa06e6343a6fd2fe84b2f5bba224145d9fe020e5174a82d10f0dd3765adf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656e756e657a2f677265636170746368612d76616c696461746f723f696e636c7564655f70726572656c6561736573)

The Google reCAPTCHA Verification PHP library is a tool for software developers to verify the response of Google reCAPTCHA v2 or v3 from within their PHP applications. This library simplifies the process of verifying the user's response to a reCAPTCHA challenge and provides an easy-to-use interface for integrating the verification process into your PHP code.

With this library, you can easily configure and set up reCAPTCHA verification for your PHP application, without the need for complicated coding. You can easily specify your reCAPTCHA API key, secret key, and other necessary configuration parameters, and then call the library functions to verify the response received from the reCAPTCHA challenge.

This library supports both the v2 and v3 versions of Google reCAPTCHA, so you can use it for a wide range of applications. It provides error handling and reporting functionality, allowing you to easily detect and handle any errors that may occur during the verification process.

The Google reCAPTCHA Verification PHP library is open-source and available for free on GitHub. This library helps you easily integrate the power of Google reCAPTCHA into your PHP application, ensuring that your users are protected from spam and abuse.

### Quick start

[](#quick-start)

#### Installation

[](#installation)

Installation is handle via Composer:

```
$ composer require enunez/grecaptcha-validator
```

or add it manually to you `composer.json` file

```
{
  "require": {
    "enunez/grecaptcha-validator": "^1.0.0"
  }
}
```

#### Usage

[](#usage)

This is a quick example of how to use the library:

```
$captcha = Builder::getInstance(YOUR_SHARED_KEY, USER_RESPONSE_TOKEN)->build();

$captcha->isValid();
```

To include the remote IP address:

```
$captcha = Builder::getInstance(YOUR_SHARED_KEY, USER_RESPONSE_TOKEN)->remoteIp(REMOTE_IP)->build();

$captcha->isValid();
```

If verification fails you can access all error codes by using:

```
if (!$captcha->isValid()) {
    foreach ($errorCode as $captcha->errorCodes()) {
        // processing the error code
    }
}
```

For more details on the supported error codes please check: [https://developers.google.com/recaptcha/docs/verify#error\_code\_reference](https://developers.google.com/recaptcha/docs/verify#error_code_reference)

License
-------

[](#license)

This library is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

1180d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6c262c00a1793143bb9516cbb86094273e1ddb0d3f4d89a103d568b24d4e12b3?d=identicon)[enunezblanco](/maintainers/enunezblanco)

---

Top Contributors

[![enunezblanco](https://avatars.githubusercontent.com/u/5915054?v=4)](https://github.com/enunezblanco "enunezblanco (2 commits)")

---

Tags

googlephprecaptcha-verificationvalidator

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/enunez-grecaptcha-validator/health.svg)

```
[![Health](https://phpackages.com/badges/enunez-grecaptcha-validator/health.svg)](https://phpackages.com/packages/enunez-grecaptcha-validator)
```

###  Alternatives

[marcosh/php-validation-dsl

A DSL for validating data in a functional fashion

483.9k](/packages/marcosh-php-validation-dsl)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
