Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 18, 2024 via composer

google/recaptcha 1.3.0

Client library for reCAPTCHA, a free service that protects websites from spam and abuse.
Package summary
Share
0
issues
1
license
1
BSD-3-Clause
Package created
12 Mar 2015
Version published
18 Feb 2023
Maintainers
1
Total deps
1
Direct deps
0
License
BSD-3-Clause

Issues

0
This package has no issues

Licenses

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
google/recaptcha@1.3.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of google/recaptcha 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does google/recaptcha do?

Google's reCAPTCHA is an invaluable tool in today's internet environment, offering a free service that strongly defends web platforms against spam and abuse. Its function revolves primarily around delivering servers-side verification required for processing responses from the reCAPTCHA service. The reCAPTCHA PHP client library is highly versatile, providing support to both version 2 and 3 of the reCAPTCHA service. Combining advanced technology with a user-friendly interface, it presents an efficient way to verify user interactions on your website, effectively separating humans from bots.

How do you use google/recaptcha?

Implementing Google's reCAPTCHA library in PHP is a relatively straightforward process. First, you should install the library to your project using Composer, which is the recommended method. By running the command composer require google/recaptcha "^1.3" in your project directory, you can easily add the necessary dependency.

Once the library is added, it's time to integrate it into your code. Get the necessary keys for v2 or v3 reCAPTCHA at the Google reCAPTCHA admin site and follow the integration guide. When you need to verify a user's response, you instantiate the ReCaptcha class with your secret key, specify potential validation rules, and call verify() with the reCAPTCHA response. The user's IP address is also required. This is how it is done:

<?php
$recaptcha = new \ReCaptcha\ReCaptcha($secret);
$resp = $recaptcha->setExpectedHostname('recaptcha-demo.appspot.com')
                  ->verify($gRecaptchaResponse, $remoteIp);
if ($resp->isSuccess()) {
    // Verified!
} else {
    $errors = $resp->getErrorCodes();
}

Remember, the setExpectedHostname() method is crucial when "Domain/Package Name Validation" for your credentials is disabled. Additional available functionalities include score threshold setting for v3 API responses, selection of a timeout interval, among others.

Where are the google/recaptcha docs?

For a comprehensive understanding of google/recaptcha and its vibrant functionalities, the reCAPTCHA PHP client library README is the authoritative information repository. In-depth details about the architecture of this library, as well as guidelines for contributing to its development, are also available. For a practical perspective, the document also provides access to examples. Furthermore, developers are welcome to explore the reCAPTCHA integration guide on the Google Developers site to learn how to integrate reCAPTCHA functionalities into the front end of a web application.