PHPackages                             kekaadrenalin/yii2-module-recaptcha-v3 - 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. kekaadrenalin/yii2-module-recaptcha-v3

ActiveYii2-extension[Authentication &amp; Authorization](/categories/authentication)

kekaadrenalin/yii2-module-recaptcha-v3
======================================

This is reCAPTCHA v3 for Yii2.

1.4(7y ago)576.5k↑79.2%7[2 issues](https://github.com/kekaadrenalin/yii2-module-recaptcha-v3/issues)1BSD-3-ClausePHP

Since Dec 22Pushed 6y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (1)Versions (6)Used By (1)

[![Total Downloads](https://camo.githubusercontent.com/3d057b25300fa59f632c2a18d3196ff2f5f21f0e73a4f4b5f23b97c672a95296/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b656b61616472656e616c696e2f796969322d6d6f64756c652d7265636170746368612d76332e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kekaadrenalin/yii2-module-recaptcha-v3)

Yii2 reCAPTCHA v3
=================

[](#yii2-recaptcha-v3)

Adds [recaptcha-v3](https://developers.google.com/recaptcha/docs/v3) into yii2 project

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist kekaadrenalin/yii2-module-recaptcha-v3 "*"

```

or add

```
"kekaadrenalin/yii2-module-recaptcha-v3": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Once the extension is installed, simply use it in your code by :

add this to your components main.php

```
'components' => [
    ...
    'reCaptcha3' => [
        'class'      => 'kekaadrenalin\recaptcha3\ReCaptcha',
        'site_key'   => 'site_key_###',
        'secret_key' => 'secret_key_###',
    ],
```

and in your model

acceptance\_score the minimum score for this request (0.0 - 1.0) or null

```
public $reCaptcha;

public function rules()
{
 	return [
 		...
 		 [['reCaptcha'], \kekaadrenalin\recaptcha3\ReCaptchaValidator::className(), 'acceptance_score' => 0]
 	];
}
```

```
