A ProcessWire module that adds a Cloudflare Turnstile input field to your forms, protecting them from bots without showing a CAPTCHA.
This module acts as a wrapper around MarkupCloudflareTurnstile, which handles the core API integration.
Features
- Smart Protection: Verifies visitors are real humans without requiring them to solve puzzles.
- Configurable: Supports different themes (Auto, Light, Dark) and sizes (Normal, Compact, Flexible).
- Easy Integration: Works like any other ProcessWire Inputfield.
- Centralized Config: Uses API keys from
MarkupCloudflareTurnstile.
Requirements
Installation
- Install MarkupCloudflareTurnstile:
- Download from the modules directory or GitHub.
- Install and configure it with your Site Key and Secret Key.
- Install InputfieldTurnstile:
- Copy the
InputfieldTurnstile directory to site/modules/. - Go to Modules > Refresh and click Install.
Usage
You can add this field to any ProcessWire form.
Via API
$form = $modules->get("InputfieldForm");
// ... add other fields ...
// Add Turnstile field
$turnstile = $modules->get("InputfieldTurnstile");
$turnstile->name = "turnstile";
$turnstile->label = "Security Check";
// Optional: Override settings
// $turnstile->turnstileTheme = 'dark';
$form->add($turnstile);
// ... render and process form ...
if($input->post->submit) {
$form->processInput($input->post);
if(!$form->getErrors()) {
// Form is valid and user is verified
}
}
License
This module is licensed under the MIT License. See the LICENSE file for details.