Skip to main content
Verify users with passkey-based MFA by prompting them to authenticate with their registered passkey.

Requesting an MFA challenge

To request an MFA challenge for the current user, call the init method from the useMfa hook, passing 'passkey' as the MFA method parameter:
import {useMfa} from '@privy-io/react-auth';

const {init, submit} = useMfa();

// Request a passkey MFA challenge
const options = await init('passkey');
When the MFA method is 'passkey', init will return an object with options to pass to the native passkey system. The method returns a Promise that resolves with these options if the challenge was successfully created, and rejects with an error if there was an issue.

Submitting the MFA verification

Once init has resolved successfully, prompt the user to select a passkey by calling submit with the options returned from the init method:
const options = await init('passkey');

// Submit will trigger the system's native passkey prompt
await submit('passkey', options);
When submit resolves successfully, the user has completed MFA and can proceed to use their embedded wallet.