Skip to content

marsidev/react-turnstile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e2f529e Β· Feb 21, 2025
Aug 21, 2024
Jan 23, 2024
Aug 15, 2024
Feb 20, 2025
Nov 18, 2024
Jul 10, 2024
Oct 16, 2022
Jun 3, 2024
Mar 31, 2023
Mar 6, 2023
Apr 26, 2024
Oct 16, 2022
Feb 21, 2024
Mar 13, 2024
Aug 15, 2024
Apr 20, 2023
Nov 18, 2024
Feb 16, 2024
Oct 17, 2022
Mar 13, 2023

Repository files navigation

React Turnstile

Cloudflare Turnstile widget

Cloudflare Turnstile integration for React.

npm version npm downloads install size bundle size CI status tested with playwright PRs are welcome

Features

  • πŸ’ͺ Smart verification with minimal user interaction
  • πŸ•΅οΈβ€β™€οΈ Privacy-focused approach
  • πŸ’‰ Automatic script injection
  • ⚑️ SSR ready
  • πŸ’» TypeScript support

Getting started

  1. Follow these steps to obtain a free site key and secret key from Cloudflare.
  2. Install @marsidev/react-turnstile into your React project.
npm i @marsidev/react-turnstile

Usage

import { Turnstile } from '@marsidev/react-turnstile'

function Widget() {
  return <Turnstile siteKey='1x00000000000000000000AA' />
}

Checkout the docs for more examples and for a detailed info about the Turnstile props.

Checkout the demo for a live example.

Contributing

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.

Development

  • Fork or clone this repository.
  • Install dependencies with pnpm install.
  • You can use pnpm dev 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.

Contributors

Contributors

Credits

Inspired by

Support

If you like this project, please consider supporting it through a PayPal donation. 😊

License

Published under the MIT License.