Module

Turnstile

A Cloudflare Turnstile humanity check for Pithy. One piece of stackable middleware. No tables of its own. It answers one question — is this a human? — and stacks on top of any route's real verification strategy.

@pithy-sh/turnstile

terminal
pithy add turnstile
Read the docs Source on GitHub

What it is for

A humanity check for the routes that need one: a public signup, the screen where a magic link is requested, a lead form that should be checked quietly.

What it sits on

Cloudflare Turnstile and one piece of middleware.

No tables of its own. It stacks on top of whatever a route already does to establish identity.

  • Workers
  • Turnstile

The honest bit

It is not a verification strategy, and treating it as one is a hole.

A route's strategy answers who is this? — bearer, session, signed-webhook, control-plane, public. A humanity check answers is this a human? They are different questions, so this can never be a route's identity gate. It composes on top of one.

If you build it yourself

A humanity check is one line and one very common mistake.

The integration is trivial. Knowing what it does not prove is what matters.

It is not authentication

It answers whether a caller is human, never who they are. Treating a passed check as identity is the bug it invites.

Verifying server-side

A token validated in the browser proves nothing at all.

Single use

A token replayed is a token wasted; the check has to be consumed once.

Composable with any strategy

It has to stack on a public route, a session route and a signed webhook alike, without becoming the gate itself.

Failing usefully

A human who fails the check needs a way forward that is not a dead end.

terminal
pithy add turnstile

Composes with

It depends on seams, never on another module's internals.

In the dashboard

Administer it from a browser, without building the screen.

Challenge outcomes per route, so you can see what a bot wave actually hit.

The dashboard is the admin interface for your own application: whatever this capability writes, your team can look up, check and act on from a browser. Reading is free, forever, with no time limit. Connect the project when you deploy.

Add it, and get on with the feature.

One command installs the package, wires its bindings into every environment your project declares, and runs its migrations.