Reclaim OAuthReclaim Auth - React
Authentication Hooks
Built-in Hooks
useReclaimAuth
The primary hook for managing authentication state and actions in your application. This hook provides a comprehensive interface for handling user authentication.
Returns
useAuthState
A simplified hook for accessing authentication state only. Useful when you only need to check user authentication status.
useAuthActions
A focused hook providing authentication action methods. Ideal when you only need authentication operations without state management.
Custom Hook Examples
useRequireAuth
A protection hook that enforces authentication by redirecting unauthorized users to a login page.
useAuthCallback
A utility hook for handling authentication callbacks with error handling and loading states.
TypeScript Integration
Using Hooks with Custom User Types
Note: Always ensure proper error handling when using authentication hooks, especially in production environments.