Obtain Cloudflare Turnstile Keys
Before you can use React Turnstile, you need to obtain a sitekey and secret key from Cloudflare.
- Go to the Cloudflare Dashboard
- Navigate to Turnstile in the sidebar
- Click Add Site to create a new widget
- Configure your widget settings and domain
- Save your sitekey (for client-side) and secret key (for server-side validation)
For development and testing, you can use Cloudflare’s test keys:
- Sitekey (always passes):
1x00000000000000000000AA - Secret key (always passes):
1x0000000000000000000000000000000AA
Add Turnstile to Your Component
Import and use the Turnstile component in your React application:
App.tsx
What’s Next?
You now have a working Turnstile widget! Here are some common next steps:Component Props
Explore all available component properties
Widget Lifecycle
Understand the widget lifecycle and callbacks
Interact with Widget
Control the widget programmatically using refs
Server Validation
Learn how to validate tokens on your server
Common Customizations
Theme
Match the widget to your site’s appearance:Size
Control the widget dimensions:Invisible Mode
For a frictionless user experience:Need Help?
Troubleshooting
Common issues and solutions
Examples
View real-world examples
GitHub
Report issues or contribute
Cloudflare Docs
Official Turnstile documentation