Skip to content

Add CAPTCHA feature docs - #759

Open
justinformentin wants to merge 5 commits into
mainfrom
docs/captcha-feature
Open

Add CAPTCHA feature docs#759
justinformentin wants to merge 5 commits into
mainfrom
docs/captcha-feature

Conversation

@justinformentin

@justinformentin justinformentin commented Aug 6, 2026

Copy link
Copy Markdown

Summary

Adds a new documentation page for Turnkey's CAPTCHA protection feature (powered by Cloudflare Turnstile).

New page

features/authentication/captcha.mdx — covers:

  • What CAPTCHA is and why Turnkey uses it (bot/abuse protection via Cloudflare Turnstile)
  • How to enable it: toggle in the Turnkey Dashboard under organization Settings
  • How it works once enabled: @turnkey/react-wallet-kit automatically renders the Turnstile widget and enforces CAPTCHA on all auth flows — no extra integration code required
  • Table of all protected auth methods (email OTP, SMS OTP, passkey, OAuth, wallet auth)

Navigation

Added features/authentication/captcha to docs.json under the Authentication section (Documentation tab → Features → Authentication), positioned after the Sessions page.

Notes

  • CAPTCHA is enabled via the Dashboard only — no API or SDK config needed by integrators
  • The react-wallet-kit handles the Turnstile widget rendering automatically
  • Action required: add the dashboard screenshot at /images/authentication/img/captcha-dashboard-toggle.png

@mintlify

mintlify Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
turnkey-docs 🟢 Ready View Preview Aug 6, 2026, 4:45 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@ethankonk ethankonk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!


[Captcha protection](/features/authentication/captcha) is enabled once, at the organization level, in the Turnkey Dashboard. Once it's on, **every signup and every OTP send** must carry a Cloudflare Turnstile token or the Auth Proxy rejects it.

`@turnkey/react-wallet-kit` renders the Turnstile widget and attaches tokens for you, so there is no integration work to do. Enable the toggle in the Dashboard and your existing auth code keeps working.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page is missing the core version warning, although the same critique applies, we should say what @turnkey/react-wallet-kit version is needed, not just what @turnkey/core version has captcha integrations

Comment on lines +53 to +55
<Note>
Captcha is in Early Access and is additionally gated per organization. If you've flipped the Dashboard toggle on but `getClientParams` still returns no site key, your organization hasn't been enabled for the feature yet, so reach out to Turnkey. The Auth Proxy won't enforce captcha in this state either, so your auth flows keep working.
</Note>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Technically the dashboard toggle is hidden when the org hasn't been allow listed in the feature gate so customers should never find themselves in this state. Wouldn't be opposed to leaving this in though since it doesn't hurt to have

Comment on lines +78 to +84
useEffect(() => {
getClientParams(authProxyConfigId).then((params) => {
if (params.turnstileSiteKey) {
setSiteKey(params.turnstileSiteKey);
}
});
}, [authProxyConfigId]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we recommend caching the site key, I think the example should reflect that maybe. don't mind this as a quickstart guide but might not be a bad idea to add a note on that below this example.

Comment on lines +115 to +117
<Warning>
`signUpWithWallet` exposes a `captchaToken` parameter but does not forward it, so the request will be rejected when captcha is enabled. Use `loginOrSignupWithWallet` for wallet signup flows.
</Warning>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uhhh this might be a bug in the SDK 😅 , we should prob fix that and remove this warning


React Native and Expo apps render the widget and attach tokens themselves. `@turnkey/react-native-wallet-kit` does not render Turnstile for you, but its `useTurnkey()` methods forward their params straight to `@turnkey/core`, so you pass `captchaToken` to them exactly as the examples below pass it to a core client.

<CaptchaCoreBasics />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-using the core version warning works well but we should also include the minimum version @turnkey/react-native-wallet-kit should be at.

Comment on lines +46 to +52
useEffect(() => {
getClientParams(authProxyConfigId).then((params) => {
if (params.turnstileSiteKey) {
setSiteKey(params.turnstileSiteKey);
}
});
}, [authProxyConfigId]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing here, we should have a note that the site key should be cached or something


## Enabling Captcha

Captcha protection is configured at the organization level in the Turnkey Dashboard. Once enabled, it is automatically enforced for the protected flows, and no changes to your application code are required.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should specify this is only the case for react-wallet-kit users

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and make that super duper obvious

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants