PHPackages                             webbuilders-group/silverstripe-turnstile - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. webbuilders-group/silverstripe-turnstile

ActiveSilverstripe-vendormodule[Validation &amp; Sanitization](/categories/validation)

webbuilders-group/silverstripe-turnstile
========================================

A spam protector and form field using CloudFlare's Turnstile

2.1.0(6mo ago)45.1k↓25%11BSD-3-ClausePHP

Since Dec 15Pushed 6mo ago2 watchersCompare

[ Source](https://github.com/webbuilders-group/silverstripe-turnstile)[ Packagist](https://packagist.org/packages/webbuilders-group/silverstripe-turnstile)[ RSS](/packages/webbuilders-group-silverstripe-turnstile/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (7)Used By (1)

Turnstile for Silverstripe
==========================

[](#turnstile-for-silverstripe)

Adds a "spam protection" field to Silverstripe userforms using Cloudflare's [Turnstile](https://www.cloudflare.com/lp/turnstile/) service.

Maintainer Contact
------------------

[](#maintainer-contact)

- Ed Chipman ([UndefinedOffset](https://github.com/UndefinedOffset))

Requirements
------------

[](#requirements)

- [Silverstripe Framework](https://github.com/silverstripe/silverstripe-framework) ^6
- [silverstripe/spamprotection](https://github.com/silverstripe/silverstripe-spamprotection) ~5.0

Installation
------------

[](#installation)

```
composer require webbuilders-group/silverstripe-turnstile

```

Configuration
-------------

[](#configuration)

There are multiple configuration options for the field, you must set the site\_key and the secret\_key which you can get from [Cloudflare](https://www.cloudflare.com/lp/turnstile/)/. These configuration options must be added to your site's yaml config typically this is `app/\_config/config.yml`.

```
SilverStripe\SpamProtection\Extension\FormSpamProtectionExtension:
  default_spam_protector: WebbuildersGroup\Turnstile\Forms\TurnstileProtector  #Set the default spam protector

WebbuildersGroup\Turnstile\Forms\TurnstileField:
  site_key: '`TURNSTILE_SITE_KEY`' #Your site key (required)
  secret_key: '`TURNSTILE_SECRET_KEY`' #Your secret key (required)
  verify_ssl: true #Allows you to disable php-curl's SSL peer verification by setting this to false (optional, defaults to true)
  default_theme: "light" #Default theme color (optional, light, dark or auto, defaults to light)
  js_onload_callback: null #Onload callback to be called when the JS for Turnstile is loaded
  proxy_server: "`SS_OUTBOUND_PROXY_SERVER`" #Your proxy server address (optional)
  proxy_port: "`SS_OUTBOUND_PROXY_PORT`" #Your proxy server address port (optional)
  proxy_auth: "`SS_OUTBOUND_PROXY_AUTH`" #Your proxy server authentication information (optional)
```

Adding field labels
-------------------

[](#adding-field-labels)

If you want to add a field label or help text to the Captcha field you can do so like this:

```
$form->enableSpamProtection()
    ->Fields()
      ->fieldByName('Captcha')
          ->setTitle('Spam protection')
          ->setDescription('Your description here');
```

Adding Custom Attributes
------------------------

[](#adding-custom-attributes)

Turnstile has a [few other options](https://developers.cloudflare.com/turnstile/get-started/client-side-rendering/#configurations) that this module does not out of the box provide hooks for setting, however you can set them your self using `setAttribute` for example:

```
$form->enableSpamProtection()
    ->Fields()
      ->fieldByName('Captcha')
          ->setAttribute('data-action', 'action')
          ->setAttribute('data-cdata', 'payload')
          ->setAttribute('data-callback', 'yourChallengeJSCallback')
          ->setAttribute('data-expired-callback', 'yourExpiredJSCallback')
          ->setAttribute('data-error-callback', 'youErrorJSCallback')
          ->setAttribute('data-tabindex', 0);
```

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance65

Regular maintenance activity

Popularity28

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~208 days

Recently: every ~224 days

Total

6

Last Release

209d ago

Major Versions

1.x-dev → 2.0.02025-06-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/4339255555acb728d7708895663e2a047a73c09f4394aa25bf038817e2d25d44?d=identicon)[WebbuildersGroup](/maintainers/WebbuildersGroup)

---

Top Contributors

[![UndefinedOffset](https://avatars.githubusercontent.com/u/1391558?v=4)](https://github.com/UndefinedOffset "UndefinedOffset (14 commits)")[![a2nt](https://avatars.githubusercontent.com/u/672794?v=4)](https://github.com/a2nt "a2nt (4 commits)")[![aaronmacpherson](https://avatars.githubusercontent.com/u/20426496?v=4)](https://github.com/aaronmacpherson "aaronmacpherson (2 commits)")[![AntonyThorpe](https://avatars.githubusercontent.com/u/1023740?v=4)](https://github.com/AntonyThorpe "AntonyThorpe (1 commits)")

---

Tags

silverstripecloudflareturnstile

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/webbuilders-group-silverstripe-turnstile/health.svg)

```
[![Health](https://phpackages.com/badges/webbuilders-group-silverstripe-turnstile/health.svg)](https://phpackages.com/packages/webbuilders-group-silverstripe-turnstile)
```

###  Alternatives

[undefinedoffset/silverstripe-nocaptcha

A spam protector and form field using Google's reCAPTCHA v2 or optionally a foundation v3 implementation

33471.6k16](/packages/undefinedoffset-silverstripe-nocaptcha)[sheadawson/silverstripe-zenvalidator

Faster, easier client and server-side form validation for SilverStripe

5778.4k2](/packages/sheadawson-silverstripe-zenvalidator)[jonom/silverstripe-text-target-length

Set character length recommendations on SilverStripe text form fields

32132.4k9](/packages/jonom-silverstripe-text-target-length)[silverstripe/mathspamprotection

This module provides a simple math protection mechanism for prevent spam from your forms.Includes an EditableMathSpamField to integrate with the UserForms module.

1917.6k](/packages/silverstripe-mathspamprotection)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
