Add CAPTCHA feature docs - #759
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
4641ad8 to
ddd60df
Compare
|
|
||
| [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. |
There was a problem hiding this comment.
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
| <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> |
There was a problem hiding this comment.
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
| useEffect(() => { | ||
| getClientParams(authProxyConfigId).then((params) => { | ||
| if (params.turnstileSiteKey) { | ||
| setSiteKey(params.turnstileSiteKey); | ||
| } | ||
| }); | ||
| }, [authProxyConfigId]); |
There was a problem hiding this comment.
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.
| <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> |
There was a problem hiding this comment.
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 /> |
There was a problem hiding this comment.
Re-using the core version warning works well but we should also include the minimum version @turnkey/react-native-wallet-kit should be at.
| useEffect(() => { | ||
| getClientParams(authProxyConfigId).then((params) => { | ||
| if (params.turnstileSiteKey) { | ||
| setSiteKey(params.turnstileSiteKey); | ||
| } | ||
| }); | ||
| }, [authProxyConfigId]); |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Should specify this is only the case for react-wallet-kit users
There was a problem hiding this comment.
and make that super duper obvious
Summary
Adds a new documentation page for Turnkey's CAPTCHA protection feature (powered by Cloudflare Turnstile).
New page
features/authentication/captcha.mdx— covers:@turnkey/react-wallet-kitautomatically renders the Turnstile widget and enforces CAPTCHA on all auth flows — no extra integration code requiredNavigation
Added
features/authentication/captchato docs.json under the Authentication section (Documentation tab → Features → Authentication), positioned after the Sessions page.Notes
/images/authentication/img/captcha-dashboard-toggle.png