useSignUp()
and useSignIn()
If Clerk's prebuilt components don't meet your specific needs or if you require more control over the authentication flow, Clerk enables you to build fully custom sign-up and sign-in flows using the useSignUp()
and useSignIn()
React hooks.
useSignUp()
The useSignUp()
hook gives you access to the SignUp
object and its available methods in order to build a custom sign-up flow. The SignUp
object will also contain the state of the sign-up attempt that is currently in progress, which gives you the ability to examine all the details and act accordingly.
Usage
Getting access to the SignUp
object from inside one of your components is simple.
The following example accesses the SignUp
object to check the current sign-up attempt's status.
The more involved example below shows an approach for creating a custom form for registering users. In this case, the Password strategy is used. This example assumes that additional requirements, like username or phone, are not enabled.
useSignIn()
The useSignIn()
hook gives you access to the SignIn
object and its available methods in order to build a custom sign-in flow. The SignIn
object will also contain the state of the sign-in attempt that is currently in progress, which gives you the ability to examine all the details and act accordingly.
Usage
Getting access to the SignIn
object from inside one of your components is simple.
The following example accesses the SignIn
object to check the current sign-in attempt's status.
The more involved example below shows an approach for creating a custom form for signing in users. In this case, a Password strategy is used.
Feedback
Last updated on