tms/cloudflare-turnstile

There is no license information available for the latest version (1.0.3) of this package.

Cloudflare’s smart CAPTCHA alternative Turnstile for Neos.Form

1.0.3 2023-02-28 10:37 UTC

This package is auto-updated.

Last update: 2024-11-28 14:34:38 UTC


README

This package provides a form element for the CAPTCHA alternative Turnstile by Cloudflare and can be used on your Neos CMS site with Neos.Form & Neos.Form.Builder.

Turnstile is Cloudflare’s smart CAPTCHA alternative. It can be embedded into any website without sending traffic through Cloudflare and works without showing visitors a CAPTCHA.

Cloudflare Turnstile documentation: https://developers.cloudflare.com/turnstile/

Install

composer require tms/cloudflare-turnstile

Usage

1.) Create a free Cloudflare account or log in to your existing one

2.) Go to Turnstile

3.) Select Add a site and fill out the form

4.) Copy the site key and secret key and add the following environment variables

# Configuration/Settings.yaml
Tms:
  Cloudflare:
    Turnstile:
      siteKey: '%env:CLOUDFLARE_TURNSTILE_SITE_KEY%'
      secretKey: '%env:CLOUDFLARE_TURNSTILE_SECRET_KEY%'

Note: In Development context the package automatically sets test keys that always pass

5.) Add the Turnstile form element to your form configuration or use the Turnstile content element in your node-based forms

prototype(Vendor.PackageName:MyForm) < prototype(Neos.Form.Builder:Form) {
    firstPage.elements {
        turnstile = Tms.Cloudflare.Turnstile:Turnstile.Definition
    }
}

Notes

By default, the Turnstile API is called on form interaction. Set lazyload: false to call the API on page load.

# Configuration/Settings.yaml
Tms:
  Cloudflare:
    Turnstile:
      lazyload: true

Acknowledgments

Development sponsored by tms.development - Online Marketing and Neos CMS Agency