Cloudflare Turnstile integration for React.
npm install @marsidev/react-turnstile* 💪 Smart verification with minimal user interaction
* 🕵️♀️ Privacy-focused approach
* 💉 Automatic script injection
* ⚡️ SSR ready
* 💻 TypeScript support
1. Follow these steps to obtain a free site key and secret key from Cloudflare.
2. Install @marsidev/react-turnstile into your React project.
``bash`
npm i @marsidev/react-turnstile
`jsx
import { Turnstile } from '@marsidev/react-turnstile'
function Widget() {
return
}
`
> Checkout the docs for more examples and for a detailed info about the Turnstile props.
> Checkout the demo for a live example.
Any contributions are greatly appreciated. If you have a suggestion that would make this project better, please fork the repo and create a Pull Request. You can also open an issue.
* Fork or clone this repository.
* Install dependencies with pnpm install.pnpm dev
* You can use to start the demo page in dev mode, which also rebuild the library when file changes are detected in the packages/lib folder.
> The library is written under the packages/lib folder, the demo page is under the demos/nextjs folder and the docs are under the docs` folder.
Inspired by
* nuxt-turnstile
* svelte-turnstile
* react-google-recaptcha-v3
* reaptcha
If you like this project, please consider supporting it through a PayPal donation. :blush:
Published under the MIT License.