@result/cf-turnstile@0.1.0Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
latest
tsutoringo/cf-turnstile@result/cf-turnstile is Cloudflare Turnstile API Wrapper
This package works with Cloudflare Workers, Node.js, Deno, Bun
JSR Score
100%
Published
a month ago (0.1.0)
@result/cf-turnstile
@tsutoringo/cf-turnstile is Cloudflare Turnstile API Wrapper
Example
// This is the demo secret key. In production, we recommend // you store your secret key(s) safely. const SECRET_KEY = '1x0000000000000000000000000000000AA'; async function handlePost(request) { const body = await request.formData(); // Turnstile injects a token in "cf-turnstile-response". const token = body.get('cf-turnstile-response'); const ip = request.headers.get('CF-Connecting-IP'); const result = await new CfTurnstile(SECRET_KEY).validate(token, ip): result.match( (response) => { // Your code... }, (error) => { // Error handling... } ); // Or unwrap const response = result.unwrap(); }
Built and signed on
View transparency logGitHub Actions
Add Package
deno add jsr:@result/cf-turnstile
Import symbol
import * as mod from "@result/cf-turnstile";
---- OR ----
Import directly with a jsr specifier
import * as mod from "jsr:@result/cf-turnstile";
Add Package
npx jsr add @result/cf-turnstile
Import symbol
import * as mod from "@result/cf-turnstile";
Add Package
yarn dlx jsr add @result/cf-turnstile
Import symbol
import * as mod from "@result/cf-turnstile";
Add Package
pnpm dlx jsr add @result/cf-turnstile
Import symbol
import * as mod from "@result/cf-turnstile";
Add Package
bunx jsr add @result/cf-turnstile
Import symbol
import * as mod from "@result/cf-turnstile";