Skip to content

Conversation

@SarahSoutoul
Copy link
Contributor

@SarahSoutoul SarahSoutoul commented Sep 30, 2025

🔎 Previews:

  • All previews can be accessed via the linked hooks under the Testing section below. This section is meant to help for the testing process and helps keep track of everything. Please note that the returns and params will be broken when checking the hooks on the preview links - this is normal as this PR will need to be merged first.. I would focus on reviewing the code examples on this PR.

What does this solve?

Fixes https://linear.app/clerk/issue/DOCS-10983/ensure-all-hooks-are-using-typedocs-have-code-examples-for-each.

This PR is part of a broader project aimed at adding more code examples to our hooks documentation. During project discussions, we agreed that the current structure of our hooks docs needed to be revisited. Currently, most of the hook pages are fully rendered through Typedoc, including code examples. However, adding additional examples through Typedoc would have required significant restructuring of the JavaScript repo.

To address this, we decided to:

Additionally, not all hooks currently use Typedoc. This PR also ensures that all hooks are properly configured to use Typedoc for their returns and parameters.

This PR includes:

  • Adding code examples for all supported SDKs.
  • Ensuring the updated Typedoc outputs are properly integrated into the docs site.

This PR will be the second in a sequence. First, we need to merge the javascript PR, which:

  • Adds JSDoc comments to the billing hooks so their returns and parameters are correctly pulled from Typedoc.
  • Updates the documentation setup to ensure Typedoc is used only for returns and parameters, not for examples or SDK explanations.

What changed?

This PR adds all the code examples for the supported SDKs for each hook + uses the newly rendered Typedoc returns/ parameters, placing them after the examples for the most part.


Testing

  • useAuth - already using typedoc, but examples need to be moved out

    • astro
    • chrome-extension
    • expo
    • react-router
    • tanstack-react-start
  • useClerk - already using typedoc, but examples need to be moved out

    • chrome-extension
    • expo
    • react-router
    • tanstack-react-start
  • useUser - already using typedoc, but examples need to be moved out

    • chrome-extension
    • expo
    • nextjs
    • react-router
    • tanstack-react-start
  • useSession - already using typedoc, but examples need to be moved out

    • chrome-extension
    • expo
    • react-router
    • tanstack-react-start
  • useSessionList - already using typedoc, but examples need to be moved out

    • chrome-extension
    • expo
    • react-router
    • tanstack-react-start
  • useSignIn - already using typedoc, but examples need to be moved out

    • chrome-extension
    • expo
    • react-router
    • tanstack-react-start
  • useSignUp - - already using typedoc, but examples need to be moved out

    • chrome-extension
    • expo
    • react-router
    • tanstack-react-start
  • useCheckout - need to be using typedoc

    • React
  • usePaymentAttempts - need to be using typedoc

    • React
  • usePaymentElement - need to be using typedoc

    • React
  • usePaymentMethods - need to be using typedoc

    • React
  • usePlans - need to be using typedoc

    • React
  • useStatements - need to be using typedoc

    • React
  • useSubscription - need to be using typedoc

    • React
  • useReverification - need to be using typedoc (examples already done)

Checklist

  • I have clicked on "Files changed" and performed a thorough self-review
  • All existing checks pass

@SarahSoutoul SarahSoutoul self-assigned this Sep 30, 2025
@vercel
Copy link

vercel bot commented Sep 30, 2025

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

Project Deployment Preview Updated (UTC)
clerk-docs Ready Ready Preview Nov 14, 2025 7:19pm

@SarahSoutoul
Copy link
Contributor Author

I cleaned up some of the examples, and moved the parameters and returns sections back to the top - I think for the hooks, they should come first. some of the examples are super long, and push all that important information really far down. for components, i think it's probably fine to have their properties at the bottom, but for hooks, i feel like you'd want to understand the hook, like what's available for the hook, before trying to use it - its a little different than just dropping in a component. let me know your stance on this though 🤔

Yeah I was divided on this, but I agree, think it's much better to have those first and then the examples. Thanks for moving them!

@alexisintech
Copy link
Member

i think this is pretty much good to go - just waiting on a reply for clerk/javascript#6901 (comment)

@SarahSoutoul
Copy link
Contributor Author

i think this is pretty much good to go - just waiting on a reply for clerk/javascript#6901 (comment)

Thanks @alexisintech - I've replied. I'm getting @wobsoriano to look at the JS PR to make sure it's all good as well and it doesn't impact anything we may have not thought of, just to let you know.


When using reverification, a user's credentials are valid for 10 minutes. Once stale, a user will need to reverify their credentials. This time duration can be customized by using the `has()` helper on the server-side. See the [guide on reverification](/docs/guides/secure/reverification) for more information.

<Typedoc src="clerk-react/use-reverification-params" />
Copy link
Member

Choose a reason for hiding this comment

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

let's get this to link to the #use-reverification-options hash

Screenshot 2025-11-13 at 19 33 56

Copy link
Member

Choose a reason for hiding this comment

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

done here: ad4cef7

@alexisintech
Copy link
Member

I did a final sweep, everythings looking good but I'll let @SarahSoutoul decide and merge as she is the OP 🙏

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.

4 participants