Skip to main content
To authorize an action that requires MFA, your app’s server verifies the user’s MFA, then passes the MFA token with the user’s JWT in user_auth. The SDK exchanges them for a user key that records the MFA, and signs the request with it. The user must be enrolled in MFA first. See enrollment with server-side MFA.

Pass the MFA token in user_auth

Send the user an SMS code, then verify it to get an MFA token. TOTP and passkeys work the same way. See server-side MFA.
This requires @privy-io/node version 0.39.0 or later.
The MFA token lasts for the cache duration. Pass the latest token on every request that may require MFA.

Examples

Each example shows a policy that requires MFA for the action, then the request with the authorizationContext from above.

Export a wallet

Exporting a private key or seed phrase requires MFA. This is the policy from setup.
The SDK decrypts the exported key for you.

Sign a message

Signing any message requires MFA.

Send a transaction

Sending more than 1 ETH requires MFA.

Update a wallet

Changing a user-owned wallet’s policies or signers requires the user’s MFA, with or without a policy. See resource updates.