UI components
Privy supports easy onboarding with an out-of-the-box user interface to log users in.
The fastest way to integrate Privy is with the Privy login modal. Your application can integrate this modal in just a few lines of code and easily toggle on login methods for your application in the Privy dashboard.
You can also design your own login UIs, and integrate with Privy’s authentication APIs to offer a login experience that feels seamless within your application.
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.
To have users login to your app with Privy’s UIs, use the 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 the login
method using the useLogin
hook. This allows you to run custom logic when a user successfully logs in or when there’s an error.
Was this page helpful?