Passkey
Privy offers the ability to sign up and log users in using a passkey. This lets users access their account simply and securely.
Login with Passkey
Use loginWithPasskey
from the useLoginWithPasskey
hook to trigger the passkey login flow.
Optionally prompt the user to sign in with a specific passkey credential.
Usage
Sign up with Passkey
Use signupWithPasskey
from the useSignupWithPasskey
hook to trigger the passkey signup flow.
Usage
Tracking Flow State
Track the state of the passkey flow via the state
variable returned by both the
useLoginWithPasskey
and useSignupWithPasskey
hooks.
The current state of the passkey flow.
The error that occurred during the passkey flow.
Callbacks
You can optionally pass callbacks into the useLoginWithPasskey
and useSignupWithPasskey
hooks to run custom logic after a successful login or signup, or to handle errors that occur during the flow.
onComplete
Parameters
The user object returned after successful login or signup.”
Whether the user is a new user or an existing user.
Whether the user was already authenticated before the passkey flow.
The login method used to authenticate the user.
The linked account if the user was already authenticated.
onError
Parameters
The error that occurred during the passkey flow.