[New Plugin] Cloudflare Turnstile

Hi Guys,

We’ve released a new plugin to use Cloudflare Turnstile in your apps to protect your login forms or contact forms.

Link to Plugin: Cloudflare Turnstile Plugin | Bubble
Link to Demo: https://relevat-digital.bubbleapps.io/version-test/turnstile
Link to Editor: Relevat Digital | Bubble Editor
Link to Docs: Cloudflare Turnstile · Cloudflare Turnstile docs

After you’ve setup your site in Cloudflare, add the relevant information back to your Bubble app: Site Key (in the element), Secret Key (in the plugin setting).

Once Turnstile has been initialized it will give you a Token. This Token must be validated against the siteverify endpoint, using the “Verify Turnstile Token” action. This action will return a “Success” state which is either True or False. A token can only be validated once and cannot be consumed twice. As soon as the Current Token expires Turnstile will generate a new one, and the whole action restarts.

2 Likes

Hi @petersas,

This is an awesome alternative to Bubble’s outdated recaptcha – is there any way to make the Turnstile widget resizeable?

1 Like

I think it has a fixed size, at least as far as I saw: 300x65px. But I’ll add the compact mode with next update, which is 130x120px.

1 Like

Great plugin, however I have some issue with reset option. I’m implementing this in my app to protect my Signup and Login forms. Initially, I had Turnstile on both forms, but I ran into issues where it wouldn’t reset the widget when switching between the two.

  • When switching between Signup and Login, the Turnstile widget doesn’t reset properly.
  • If I reset Turnstile on the Login page, it works, but it doesn’t reset when switching back to Signup (and vice versa).
  • Only a full page reload resets the widget.
    Any ideas?

Hi @ligers.gints,

If you use multiple Turnstile you’d want to reset each with the “Reset Turnstile” action and choose the relevant element. The element also resets automatically when the token expires usually 2 minutes.