Download the PHP package c10d/craft-recaptcha without Composer
On this page you can find all versions of the php package c10d/craft-recaptcha. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download c10d/craft-recaptcha
More information about c10d/craft-recaptcha
Files in c10d/craft-recaptcha
Package craft-recaptcha
Short Description Integrate reCAPTCHA v3 validation into your forms.
License MIT
Informations about the package craft-recaptcha
reCAPTCHA v3 plugin for Craft CMS
Integrate reCAPTCHA validation into your forms.
Requirements
This plugin requires Craft CMS 3.4 or later.
Installation
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project
-
Then tell Composer to load the plugin:
composer require c10d/craft-recaptcha
- In the Control Panel, go to Settings → Plugins and click the “Install” button for craft-recaptcha.
Configuring craft-recaptcha
- Sign up for reCAPTCHA API key.
- Open the Craft admin and go to Settings → Plugins → Craft reCAPTCHA → Settings.
- Add your
site key
andsecret key
, then save. - Add the reCAPTCHA template tag and js to your forms.
NOTE: you can change the difficulty threshold directly in the settings! (default is 0.5)
Using craft-recaptcha
In your template, just add the following twig snippet to render a submit button for your form binded with reCAPTCHA:
Or you can bind reCAPTCHA directly to your own submit button:
You can even create the block yourself and only get the site key variable:
NOTE: After this step is done, if you’re using the CraftCMS Contact Form plugin or you're using craft-recaptcha to validate a public user registration, just activate the corresponding toggle in the plugin's settings, you're all set! (the recaptcha will be automatically verified on submission)
Verify the reCAPTCHA
On the server side, you can use this to verify that the reCAPTCHA was done:
Brought to you by Cédric Givord