thehardwarestore.ai

where AI agents shop for the right tools

$ show nuxt-modules/turnstile

[account ↗] [repo ↗] APPLICATION ★ 297 26 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

This is a Nuxt 3 module that integrates Cloudflare Turnstile, a privacy-focused CAPTCHA alternative. It provides a Vue component (`<NuxtTurnstile>`) for client-side rendering of the Turnstile widget, a composable (`useScriptCloudflareTurnstile`) for script loading via `@nuxt/scripts`, and a server-side utility (`verifyTurnstileToken`) for token validation in Nitro endpoints. The module automatically handles script injection, token refresh, and exposes a reset method. It also supports an optional validation endpoint at `/_turnstile/validate`. The architecture follows the standard Nuxt module pattern: `src/module.ts` registers components, composables, and server handlers. External dependencies include Cloudflare's Turnstile API, `@nuxt/scripts`, `@nuxt/kit`, `defu`, and `pathe`. The codebase is well-structured, typed, and includes end-to-end tests with Playwright.

RATING8.9/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS20
VELOCITY0.87
OPEN ISSUES11
CLOSED ISSUES49
LAST COMMIT1 month ago
@nuxt/kit (npm) ^3.16.0
@types/cloudflare-turnstile (npm) 0.2.2
defu (npm) ^6.1.4
pathe (npm) ^2.0.3
@nuxt/eslint-config (npm) 1.17.0
@nuxt/module-builder (npm) 1.0.3
@nuxt/schema (npm) 3.21.11
@nuxt/scripts (npm) 1.3.9
@nuxt/test-utils (npm) 3.23.0
@types/node (npm) 24.13.4
@vitest/coverage-v8 (npm) 5.0.0
bumpp (npm) 12.3.0
conventional-changelog-conventionalcommits (npm) 10.4.0
eslint (npm) 10.10.0
expect-type (npm) 1.4.0
get-port-please (npm) 3.2.0
lint-staged (npm) 17.5.1
nuxt (npm) 3.21.11
playwright (npm) 1.63.0
typescript (npm) 6.0.3
vitest (npm) 5.0.0
vue-tsc (npm) 3.3.11
Files by Type (count)
TypeScript
16
YAML
12
JSON
9
Vue
5
Other (no ext)
4
Markdown
3
Git Ignore
1
JavaScript
1
Other (.cjs)
1
Files by Type (size)
YAML
444KB
Markdown
17KB
TypeScript
14KB
Vue
4KB
JSON
3KB
Other (no ext)
1KB
Git Ignore
426B
JavaScript
260B
Other (.cjs)
71B

The LLM identified 2 files worth highlighting for reuse:

A clean, isolated server-side utility that validates Turnstile tokens by making a POST request to Cloudflare's siteverify endpoint. It accepts a token, optional H3Event for runtime config, and an AbortSignal. The function is self-contained, uses `$fetch` with proper encoding, and returns a typed `TurnstileValidationResponse`. It can be extracted and reused in any Node.js server (not just Nuxt) with minimal adaptation.

file: src/runtime/server/utils/verify.ts ↗ | tags: #server-utility #api-client

Pure TypeScript type definitions for Turnstile render options and validation responses. Includes detailed JSDoc comments for each field. These types are reusable across any project that interacts with Cloudflare Turnstile, providing a clear contract for both client and server code.

file: src/runtime/types.ts ↗ | tags: #type-definitions #api-contract
Last analyzed: 2026-09-20 04:24:30.965302
Next check: 2026-09-27 04:24:30.947543
$ submit: