Turnstile (Cloudflare

Adds a Cloudflare Turnstile input, preventing submission until user successfully completes it.

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


  1. Install MarkupCloudflareTurnstile:
    • Download from the modules directory or GitHub.
    • Install and configure it with your Site Key and Secret Key.
  2. Install InputfieldTurnstile:
    • Copy the InputfieldTurnstile directory to site/modules/.
    • Go to Modules > Refresh and click Install.

Usage


In Form Builder or Custom Forms

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.

More modules by Eduardo San Miguel Garcia

  • Recurring Dates

    Field that stores recurring events from a UI to define RRules.
  • Alpine.js

    ModuleJS module to add Alpine.js to ProcessWire.
  • Turnstile (Cloudflare

    Adds a Cloudflare Turnstile input, preventing submission until user successfully completes it.
  • Inputfield Radios Image Label

    Radios that use images/labels instead of standard radio buttons, suitable for FieldtypeOptions.
  • Tripleseat Lead Form API Integration

    Forwards forms to Tripleseat using their Lead Form API

All modules by Eduardo San Miguel Garcia

Install and use modules at your own risk. Always have a site and database backup before installing new modules.