Package Manager Installation
Install@marsidev/react-turnstile using your preferred package manager:
Peer Dependencies
React Turnstile requires React and React DOM as peer dependencies. The package supports:- React:
^17.0.2 || ^18.0.0 || ^19.0 - React DOM:
^17.0.2 || ^18.0.0 || ^19.0
If you’re using a modern React application framework like Next.js, Create React App, or Vite, these dependencies are already included in your project.
Verify Installation
After installation, verify that the package is correctly installed by checking yourpackage.json:
package.json
TypeScript Support
React Turnstile is written in TypeScript and includes built-in type definitions. No additional@types packages are required.
Type definitions are automatically available when you import the package:
What’s Included
The package exports:Turnstile- Main React component for rendering Turnstile widgets- TypeScript types - Complete type definitions for all props and API methods
- Constants - Default configuration values like
DEFAULT_CONTAINER_ID,DEFAULT_SCRIPT_ID - ESM module - Modern ES module format for optimal tree-shaking
Next Steps
Once installed, you’re ready to integrate Turnstile into your application:Quickstart
Get your first Turnstile widget up and running in minutes
Basic Usage
Learn the fundamentals of using the Turnstile component