ReactHooks
Overview
Generated hooks for session state, sign-in, sign-up, password recovery, email verification, and client access.
| Hook | Purpose | Shipped by | Documentation |
|---|---|---|---|
useCurrentUser | Load the signed-in user with auth.me(). | init | useCurrentUser |
useAuth | Convenience { isLoading, isSignedIn, isEmailVerified, user } over useCurrentUser. | add session | useAuth |
useGoogleAuth | Start the Google OAuth redirect (auth.signInWithGoogle). | add google-auth | useGoogleAuth |
useGithubAuth | Start the GitHub OAuth redirect (auth.signInWithGithub). | add github-auth | useGithubAuth |
useSignIn | Email and password sign-in with loading and error state. | add sign-in | useSignIn |
useSignUp | Registration with loading, error state, and optional verification email helper. | add sign-up | useSignUp |
useForgotPassword | Request a password reset email. | add forgot-password | useForgotPassword |
useResetPassword | Complete password reset with token from email. | add reset-password | useResetPassword |
useVerifyEmail | Verify email from link token; optional auto-run when token is passed. | add verify-email | useVerifyEmail |
useSendVerificationEmail | Resend verification email for an address. | add verify-email | useSendVerificationEmail |
useSignOut | End session with auth.logout(). | add sign-out | useSignOut |
useDeleteAccount | Delete the current account with password confirmation. | add delete-account | useDeleteAccount |
useSimpleAuthClient | Read the browser SimpleAuthClient from context. | init | useSimpleAuthClient |
Source
Each hook page in this section ends with a Source panel: it shows the exact files the CLI writes under components/simpleauth/hooks/ (from the @simpleauthjs/react templates). Open any hook from the table above to view and copy the generated code.