ReCAPTCHA::__construct
Set the reCAPTCHA secret key and score threshold
Description
public ReCAPTCHA::__construct( string $secret, [ float $threshold = 0.5 ] )
Arguments
| Name | Data type | Default | Remarks |
|---|---|---|---|
| $secret | string | reCAPTCHA secret key. Read it from site/config/env.php with feggEnv('FEGG_RECAPTCHA_SECRET') | |
| $threshold | float | 0.5 | Minimum score (0.0 to 1.0) / a lower score fails ReCAPTCHA::auth |
Example
Controller
use Fegg\Captcha\ReCAPTCHA;
$recaptcha = new ReCAPTCHA(feggEnv('FEGG_RECAPTCHA_SECRET', ''), 0.5);