
Configure your login methods in the Privy
Dashboard before using the UI components.
Privy’s UIs are highly-customizable to seamlessly match the branding and design system of your
app. Learn more about customizing the login modal.
login
method from the useLogin
hook.Usage
Parameters
Optionally specify which login methods to display in the modal.
Optionally pre-fill the login modal with the user’s email or phone number.
Prevent users from signing up for your app. This is useful when you want to enforce that users can only log in with existing accounts.
Filter the login wallet options to only show wallets that support the specified chain type.
Callbacks
You can easily attach callbacks to thelogin
method using the useLogin
hook. This allows you to run custom logic when a user successfully logs in or when there’s an error.Callback that executes when a user completes authentication. If the user is already authenticated when the component mounts, this callback executes immediately. Otherwise, it executes after successful login.
Callback that executes when there’s an error during login or when the user exits the login flow.