wearesho-team / recaptcha-v3
reCAPTCHA v3 integration
Installs: 610
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 2
pkg:composer/wearesho-team/recaptcha-v3
Requires
- php: >=7.1
- guzzlehttp/guzzle: ^6.3
- horat1us/environment-config: ^1.2
Requires (Dev)
- phpunit/phpunit: ^7.2
- squizlabs/php_codesniffer: ^3.3
This package is auto-updated.
Last update: 2025-10-15 05:18:56 UTC
README
Simple server check implementation for reCAPTCHA v3
Note: This is a Beta version of reCAPTCHA which is still undergoing final testing before its official release. The API, documentation, and policy are subject to change in the future.
Installation
composer require wearesho-team/recaptcha-v3
Usage
See example.php for details
<?php use Wearesho\ReCaptcha; $response = $_POST['g-recaptcha-response']; $ip = $_SERVER['REMOTE_ADDR'] ?? null; $config = new ReCaptcha\V3\Config($secret = "..."); $client = new ReCaptcha\V3\Client($config); try { $response = $client->verify($response, $ip); } catch (ReCaptcha\V3\Exception $e) { $response = $e->getResponse(); // do something if token is not valid } $response->getScore(); // score from 0 to 1
Environment
Use EnvironmentConfig to configure application using environment. Keys:
- RECAPTCHA_SECRET - secret, will be sent while verifying