SimpleAuth
ReactHooks

Overview

Generated hooks for session state, sign-in, sign-up, password recovery, email verification, and client access.

HookPurposeShipped byDocumentation
useCurrentUserLoad the signed-in user with auth.me().inituseCurrentUser
useAuthConvenience { isLoading, isSignedIn, isEmailVerified, user } over useCurrentUser.add sessionuseAuth
useGoogleAuthStart the Google OAuth redirect (auth.signInWithGoogle).add google-authuseGoogleAuth
useGithubAuthStart the GitHub OAuth redirect (auth.signInWithGithub).add github-authuseGithubAuth
useSignInEmail and password sign-in with loading and error state.add sign-inuseSignIn
useSignUpRegistration with loading, error state, and optional verification email helper.add sign-upuseSignUp
useForgotPasswordRequest a password reset email.add forgot-passworduseForgotPassword
useResetPasswordComplete password reset with token from email.add reset-passworduseResetPassword
useVerifyEmailVerify email from link token; optional auto-run when token is passed.add verify-emailuseVerifyEmail
useSendVerificationEmailResend verification email for an address.add verify-emailuseSendVerificationEmail
useSignOutEnd session with auth.logout().add sign-outuseSignOut
useDeleteAccountDelete the current account with password confirmation.add delete-accountuseDeleteAccount
useSimpleAuthClientRead the browser SimpleAuthClient from context.inituseSimpleAuthClient

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.

On this page