Overview
Nuxt Turnstile is a package for integrating Cloudflare Turnstile verification into Nuxt 3 projects. It provides a privacy-focused approach to smart verification with minimal user interaction. This package allows you to easily add server validation for your Nitro endpoints and is lightweight, with the script loaded only when required.
Features
- Smart Verification: Nuxt Turnstile offers smart verification with minimal user interaction.
- Privacy-Focused Approach: This package takes a privacy-focused approach to verification.
- Server Validation Helper: It provides a server validation helper for your Nitro endpoints.
Installation
To install Nuxt Turnstile, follow these steps:
- Obtain a free sitekey and secret key from Cloudflare.
- Install and add
@nuxtjs/turnstile
to yournuxt.config.js
file. - Alternatively, you can set
turnstile.secretKeyPath
to a path to a file containing the secret key. This will be read at build-time and will override any other explicit secret key you have set.
Tip: At runtime, you can override site and secret keys with the NUXT_TURNSTILE_SECRET_KEY
and NUXT_PUBLIC_TURNSTILE_SITE_KEY
environment variables.
Summary
Nuxt Turnstile is a package for integrating Cloudflare Turnstile verification into Nuxt 3 projects. It offers smart verification with minimal user interaction and follows a privacy-focused approach. With server validation helpers for Nitro endpoints, this lightweight package only loads the script when required. Installation involves obtaining Cloudflare sitekey and secret key, and adding the package to the nuxt.config.js
file.