Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/boywithkeyboard-archive/turnstile
A type-safe server-side validator for Turnstile, Cloudflare's free CAPTCHA solution.
https://github.com/boywithkeyboard-archive/turnstile
cjs cloudflare deno esm javascript node turnstile typescript
Last synced: 12 days ago
JSON representation
A type-safe server-side validator for Turnstile, Cloudflare's free CAPTCHA solution.
- Host: GitHub
- URL: https://github.com/boywithkeyboard-archive/turnstile
- Owner: boywithkeyboard-archive
- License: mit
- Created: 2023-05-24T21:33:38.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-16T04:16:24.000Z (2 months ago)
- Last Synced: 2024-10-16T03:31:29.301Z (about 1 month ago)
- Topics: cjs, cloudflare, deno, esm, javascript, node, turnstile, typescript
- Language: TypeScript
- Homepage: https://npmjs.com/@boywithkeyboard/turnstile
- Size: 54.7 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- License: license
Awesome Lists containing this project
README
## turnstile
> [!IMPORTANT]
> Please [read this article](https://developers.cloudflare.com/turnstile/get-started/server-side-validation) to learn more.### Setup
#### Deno
```ts
import { turnstile } from 'https://esm.sh/@boywithkeyboard/turnstile'
```#### Node.js
```bash
npm i @boywithkeyboard/turnstile
``````ts
import { turnstile } from '@boywithkeyboard/turnstile'
```### Usage
```ts
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')
})
}
```