More Premium Hugo Themes Premium Nuxt Themes

Turnstile

Cloudflare Turnstile integration for Nuxt

Turnstile

Cloudflare Turnstile integration for Nuxt

Author Avatar Theme by nuxt-modules
Github Stars Github Stars: 267
Last Commit Last Commit: May 21, 2025 -
First Commit Created: Dec 18, 2023 -
default image

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:

  1. Obtain a free sitekey and secret key from Cloudflare.
  2. Install and add @nuxtjs/turnstile to your nuxt.config.js file.
  3. 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.