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

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

mysuse/yii2-module-recaptcha-v3
===============================

This is reCAPTCHA v3 for Yii2

v1.0(7mo ago)013BSD-3-ClausePHP

Since Sep 30Pushed 7mo agoCompare

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

READMEChangelogDependencies (1)Versions (3)Used By (0)

[![Total Downloads](https://camo.githubusercontent.com/41b8c36d0b99fa57c7dce699e6cccb1cb8b658653479590c2df3f0e0654bace4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d79737573652f796969322d6d6f64756c652d7265636170746368612d76332e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mysuse/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 mysuse/yii2-module-recaptcha-v3 "*"

```

or add

```
"mysuse/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'      => 'mysuse\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'], \mysuse\recaptcha3\ReCaptchaValidator::className(), 'acceptance_score' => 0]
 	];
}
```

```
