Enrolling in MFA does not automatically verify the user for wallet operations. Once enrolled,
subsequent wallet actions will require MFA verification. See the verification
guides for how to complete MFA
verification.
- React
- React Native
- Swift
Setup
To enroll users in MFA with passkeys, use theinitEnrollmentWithPasskey and submitEnrollmentWithPasskey methods returned by the useMfaEnrollment hook:Initiating enrollment
First, initiate enrollment by calling Privy’sinitEnrollmentWithPasskey method with no parameters. This method returns a Promise that will resolve to void indicating success.Completing enrollment
Then, to have the user enroll, you must call Privy’ssubmitEnrollmentWithPasskey method with a list of the user’s passkey account credentialIds. You can find this list by querying the user’s linkedAccounts array for all accounts of type: 'passkey':See an end-to-end example of enrolling users in MFA with passkeys
See an end-to-end example of enrolling users in MFA with passkeys
The component below serves as a reference implementation for how to enroll your users in MFA with passkeys!
Example enrolling passkeys for MFA

