PHPackages                             denis303/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. [Security](/categories/security)
4. /
5. denis303/codeigniter4-recaptcha

ActiveLibrary[Security](/categories/security)

denis303/codeigniter4-recaptcha
===============================

209.9k15[3 issues](https://github.com/denis303/codeigniter4-recaptcha/issues)[3 PRs](https://github.com/denis303/codeigniter4-recaptcha/pulls)PHP

Since Oct 24Pushed 3y ago3 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Google reCAPTCHA CodeIgniter 4 Library
======================================

[](#google-recaptcha-codeigniter-4-library)

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

[](#installation)

`composer require denis303/codeigniter4-recaptcha:dev-master`

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

[](#configuration)

In the .env file you need to add your personal ReCaptcha keys.

```
# --------------------------------------------------------------------
# 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 validator:

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

```

### 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();

```

### Checking ReCaptcha in a model:

[](#checking-recaptcha-in-a-model)

```
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.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity31

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/57e1202e5b16f400586ffeeb19d75d18c44488eb824d4a958b541ecd73ad25dd?d=identicon)[denis303](/maintainers/denis303)

---

Top Contributors

[![denis303](https://avatars.githubusercontent.com/u/55409598?v=4)](https://github.com/denis303 "denis303 (1 commits)")

### Embed Badge

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

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

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[enlightn/security-checker

A PHP dependency vulnerabilities scanner based on the Security Advisories Database.

33732.2M110](/packages/enlightn-security-checker)

PHPackages © 2026

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