User Types
LogtoUser
Represents an authenticated user in the application.Unique identifier for the user
Display name of the user
Email address of the user
URL to the user’s avatar/profile picture
Additional custom properties from the identity provider
Authentication Types
AuthMiddleware
Defines the authentication requirement level for a page or route.'auth'- Requires authenticated user'guest'- Allows unauthenticated access (guest mode)undefined- No middleware applied
NavigationOptions
Options for controlling navigation behavior.Use
replaceState instead of pushState to avoid adding to browser historyForce navigation even if already on the same page
AuthOptions
Configuration options for authentication behavior and redirects.Authentication middleware type to apply
URL to redirect to after authentication
URL to redirect to if user is already authenticated
Options for controlling navigation behavior
Context Types
AuthContextType
The authentication context type provided byuseAuth() hook.
The currently authenticated user, or
null if not authenticatedIndicates if user data is currently being loaded
Function to initiate sign-in flow
callbackUrl- URL to redirect to after successful sign-inusePopup- Whether to use popup sign-in instead of redirect
Function to sign out the current user
callbackUrl- URL to redirect to after sign-outglobal- Whether to perform global sign-out across all sessions
Function to refresh authentication state and user data
Whether popup sign-in is enabled
Component Props
AuthProviderProps
Props for theAuthProvider component.
Child components to render within the auth context
Logto configuration object containing
endpoint, appId, and resourcesDefault callback URL for authentication redirects
Custom navigation function (e.g., for React Router integration)
Enable popup-based sign-in flow
CallbackPageProps
Props for theCallbackPage component.
CSS class name for styling the callback page
Custom component to display during authentication callback processing
Custom component to display on successful authentication
Callback function executed on successful authentication
Callback function executed on authentication error
AdditionalPage
Defines additional pages/links for UI components.URL or path for the page
Display text for the link
Optional icon element to display with the link