Skip to content

Update reverification docs#3394

Open
alexisintech wants to merge 4 commits into
mainfrom
aa/update-reverification
Open

Update reverification docs#3394
alexisintech wants to merge 4 commits into
mainfrom
aa/update-reverification

Conversation

@alexisintech

@alexisintech alexisintech commented May 26, 2026

Copy link
Copy Markdown
Member

🔎 Previews:

What does this solve?

While working on the update-password custom flow, I noticed the reverification docs were incorrect. The isReverificationCancelledError was being imported from clerk/shared, which users are advised against doing per this Slack discussion. This was incorrect anyways, because it's re-exported from the appropriate SDK's, so importing from clerk/shared wasn't necessary. Also, drops support for Expo as it does not support the useReverification() hook opening a modal (talked with Mike to add reverification work to the mobile team's radar).

What changed?

docs/reference/hooks/use-reverification.mdx:

  • Drops the redundant isClerkRuntimeError(e) && guard from cancellation checks — isReverificationCancelledError already narrows correctly on its own, matching the canonical usage in the useReverification JSDoc in clerk/javascript.
  • Switches react-router and tanstack-react-start examples from importing isReverificationCancelledError out of @clerk/shared to the SDK's own /errors subpath (@clerk/react-router/errors, @clerk/tanstack-react-start/errors), aligning them with the react and nextjs examples.
  • Removes the cancellation import and catch branch from the chrome-extension examples, since @clerk/chrome-extension does not expose an ./errors subpath export.
  • (Collaborated with @mikepitre on this): Removes Expo support since useReverification() doesn't open the modal on native Expo.

docs/guides/secure/reverification.mdx:

  • Restructures the "How to require reverification" section in a more guiding manner with setting up the server-side first, then the client-side. It adds notes about adapting to other frameworks, with Ruby branched off via <If sdk="ruby">. It adds an <If sdk="nextjs" wrapper around an example for performing reverification in Server Actions.
  • Tightens copy throughout and points readers at the reference doc for the comprehensive useReverification() examples instead of duplicating them.

docs/reference/ruby/overview.mdx:

  • Adds a "See the Reverification guide for detailed usage examples" pointer under the reverification section so the Ruby reference cross-links to the rewritten guide.

Deadline

  • No rush.

Other resources

Relevant Slack conversation regarding error helpers

@alexisintech alexisintech requested a review from a team as a code owner May 26, 2026 22:46
@vercel

vercel Bot commented May 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-docs Ready Ready Preview Jun 11, 2026 9:14pm

Request Review

@SarahSoutoul

Copy link
Copy Markdown
Contributor

@alexisintech just checking, this is ready for review? It's still in draft but got a review request email.

@SarahSoutoul SarahSoutoul self-assigned this May 28, 2026
@alexisintech

Copy link
Copy Markdown
Member Author

@alexisintech just checking, this is ready for review? It's still in draft but got a review request email.

i reverted it to draft - its waiting on some expo stuff

@alexisintech alexisintech changed the title Update useReverification error handling examples Update reverification docs Jun 11, 2026
@alexisintech

Copy link
Copy Markdown
Member Author

follow up from the mobile team on the expo stuff:
Screenshot 2026-06-10 at 18 04 52

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@alexisintech

alexisintech commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

Pushed some changes directly in 51fe646.

  • API route example: return new NextResponse({ success: true }) was passing a plain object to the Response constructor (which only accepts BodyInit) — switched to NextResponse.json({ success: true }) so the example actually returns JSON.
  • Dropped the unused req: NextRequest parameter and trimmed the matching import.
  • Fixed the prose pointing at the route: /reverification-example/api/reverification-example so it matches the actual served path and what transferMoney fetches.
  • Rewrote the Ruby example to use the helpers clerk-sdk-ruby actually exports — require_reverification! with Clerk::StepUp::Preset::MODERATE — instead of clerk_render_reverification / Clerk::StepUp::PRESETS[:moderate], which don't exist on the current SDK. This also brings the constant style in line with the docs/reference/ruby/overview.mdx changes elsewhere in this PR.
  • Renamed the Ruby-branch transfer example from src/pages/transfer.tsx + TransferMoney (Pages-Router-looking path with a mismatched component name) to src/components/TransferButton.tsx + TransferButton, so the file path, package (@clerk/react), and export all match.

@alexisintech alexisintech marked this pull request as ready for review June 11, 2026 01:20
Comment thread docs/guides/secure/reverification.mdx Outdated
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