Skip to content

boywithkeyboard/turnstile

Repository files navigation

turnstile

Important

Please read this article to learn more.

Setup

Deno

import { turnstile } from 'https://esm.sh/@boywithkeyboard/turnstile'

Node.js

npm i @boywithkeyboard/turnstile
import { turnstile } from '@boywithkeyboard/turnstile'

Usage

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')
  })
}