A type-safe server-side validator for Turnstile, Cloudflare's free CAPTCHA alternative.
Repository
Current version released
a year ago
Versions
turnstile
Important
Please read this article to learn more.
Setup
Deno
import { turnstile } from 'https://den.ooo/turnstile'
Node.js
npm i @boywithkeyboard/turnstile
import { turnstile } from '@boywithkeyboard/turnstile'
Usage
// e.g.
async function handleRequest(req) {
const body = await req.formData()
const result = await turnstile.verify({
secret: '...',
response: body.get('cf-turnstile-response'),
ip: req.headers.get('cf-connecting-ip')
})
}