PHPackages                             sooluh/codeigniter4-recaptcha - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. sooluh/codeigniter4-recaptcha

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

sooluh/codeigniter4-recaptcha
=============================

CodeIgniter 4 verifier for Google reCAPTCHA v2 and reCAPTCHA v3

0.0.2(2y ago)02201MITPHPPHP &gt;=7.4

Since Aug 31Pushed 2y ago1 watchersCompare

[ Source](https://github.com/sooluh/codeigniter4-recaptcha)[ Packagist](https://packagist.org/packages/sooluh/codeigniter4-recaptcha)[ Docs](https://github.com/sooluh/codeigniter4-recaptcha)[ RSS](/packages/sooluh-codeigniter4-recaptcha/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

[![I stand with Palestine](https://github.com/Safouene1/support-palestine-banner/raw/master/banner-project.svg)](https://s.id/standwithpalestine)

CodeIgniter 4 reCAPTCHA
=======================

[](#codeigniter-4-recaptcha)

[![Latest Stable Version](https://camo.githubusercontent.com/f469460ee5101f7e037ab5ccf5f7f541b228c40f06d7edc7fcca8506228d85ae/687474703a2f2f706f7365722e707567782e6f72672f736f6f6c75682f636f646569676e69746572342d7265636170746368612f76)](https://packagist.org/packages/sooluh/codeigniter4-recaptcha)[![Total Downloads](https://camo.githubusercontent.com/9828ff3daf5fb5fe27263b5884a9395d037fc737a5d3a5100a4471eb40f79cb5/687474703a2f2f706f7365722e707567782e6f72672f736f6f6c75682f636f646569676e69746572342d7265636170746368612f646f776e6c6f616473)](https://packagist.org/packages/sooluh/codeigniter4-recaptcha)[![Latest Unstable Version](https://camo.githubusercontent.com/5cd6d5ca42ee9637aa7d25be93da0584ff7425606266d5856a512155956942c9/687474703a2f2f706f7365722e707567782e6f72672f736f6f6c75682f636f646569676e69746572342d7265636170746368612f762f756e737461626c65)](https://packagist.org/packages/sooluh/codeigniter4-recaptcha)[![License](https://camo.githubusercontent.com/cf58bfb62928357ce38997195f10a082008f11e342324e7e557cd48a78105a7f/687474703a2f2f706f7365722e707567782e6f72672f736f6f6c75682f636f646569676e69746572342d7265636170746368612f6c6963656e7365)](https://packagist.org/packages/sooluh/codeigniter4-recaptcha)

CodeIgniter 4 verifier for Google reCAPTCHA v2 and reCAPTCHA v3.

Requirements
------------

[](#requirements)

- PHP &gt;= 7.4
- Composer

Features
--------

[](#features)

- PSR-4 autoloading compliant structure
- PSR-2 compliant code style
- Useful tools for better code included

Installation
------------

[](#installation)

Install the package with:

```
composer require sooluh/codeigniter4-recaptcha
```

Configuration
-------------

[](#configuration)

Add your reCAPTCHA keys to the `.env` file.

```
# --------------------------------------------------------------------
# ReCaptcha 2
# --------------------------------------------------------------------
recaptcha2.key = 'XXXXXXXX-XXXXXXXX'
recaptcha2.secret = 'XXXXXXXX-XXXXXXXX'

# --------------------------------------------------------------------
# ReCaptcha 3
# --------------------------------------------------------------------
recaptcha3.key = 'XXXXXXXX-XXXXXXXX'
recaptcha3.secret = 'XXXXXXXX-XXXXXXXX'
recaptcha3.scoreThreshold = 0.5
```

In the `/app/Config/Validation.php` file, you need to add settings for the validator.

```
public $ruleSets = [
    ...
    \ReCaptcha\Validation\ReCaptchaRules::class
];
```

Usage
-----

[](#usage)

### Rendering reCAPTCHA v2

[](#rendering-recaptcha-v2)

```
helper(['form', 'reCaptcha']);

echo form_open();

echo reCaptcha2('reCaptcha2', ['id' => 'recaptcha_v2'], ['theme' => 'dark']);

echo form_submit('submit', 'Submit');

echo form_close();
```

### Rendering reCAPTCHA v3

[](#rendering-recaptcha-v3)

```
helper(['form', 'reCaptcha']);

echo form_open();

echo reCaptcha3('reCaptcha3', ['id' => 'recaptcha_v3'], ['action' => 'contactForm']);

echo form_submit('submit', 'Submit');

echo form_close();
```

### Validation

[](#validation)

```
public $validationRules = [
    'reCaptcha2' => 'required|reCaptcha2[]',
    'reCaptcha3' => 'required|reCaptcha3[contactForm,0.9]'
    ....
];
```

> In the settings of the reCaptcha3 validator, the first parameter you specify is expectedAction, this parameter is not required.
> You can override a global scoreThreshold parameter in the second reCaptcha3 rule parameter.

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.

**Acknowledgements**

This project is built upon the foundation of [codeigniter4-recaptcha repository](https://github.com/denis303/codeigniter4-recaptcha) created by [denis303](https://github.com/denis303). The decision to use this basecode was motivated by its robust architecture and existing functionalities.

**Note**

Please note that the original repository might not have been active for the past 2 years and the original developer's GitHub profile indicates limited recent activity.

**Disclaimer**

This project has been modified to address certain issues and to suit the requirements of this project.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

992d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/31d60fa1ab84cc5a95db6220335228643c7c6b7777d77300421751a829fba331?d=identicon)[sooluh](/maintainers/sooluh)

---

Top Contributors

[![sooluh](https://avatars.githubusercontent.com/u/20874779?v=4)](https://github.com/sooluh "sooluh (3 commits)")

---

Tags

googlerecaptcha

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/sooluh-codeigniter4-recaptcha/health.svg)

```
[![Health](https://phpackages.com/badges/sooluh-codeigniter4-recaptcha/health.svg)](https://phpackages.com/packages/sooluh-codeigniter4-recaptcha)
```

###  Alternatives

[arcanedev/no-captcha

No CAPTCHA (new Google reCAPTCHA) with Laravel support

370730.4k6](/packages/arcanedev-no-captcha)[buzz/laravel-google-captcha

Google captcha for Laravel

2071.1M2](/packages/buzz-laravel-google-captcha)[contributte/recaptcha

Google reCAPTCHA for Nette - Forms

421.3M4](/packages/contributte-recaptcha)[crabstudio/recaptcha

Easily use Google Recaptcha in CakePHP projects

20112.2k1](/packages/crabstudio-recaptcha)

PHPackages © 2026

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