Skip to main content

Enable MFA

Use the useEnableMFA hook to let users enable Multi-Factor Authentication for their embedded wallet.

note

This is a paid feature and the minimum pricing plan to use this SDK in a production environment is the Scale Plan. You can use this feature in Web3Auth Sapphire Devnet network for free.

info

MFA is only available for social login embedded wallets. It is not supported for external wallet connections.

Import

import { useEnableMFA } from '@web3auth/react-native-sdk'

Usage

import { useEnableMFA } from '@web3auth/react-native-sdk'

function EnableMFAView() {
const { enableMFA, loading, error } = useEnableMFA()

return (
<View>
<Text>Secure your wallet with Multi-Factor Authentication.</Text>
<Button
title={loading ? 'Setting up MFA…' : 'Enable MFA'}
disabled={loading}
onPress={() => enableMFA()}
/>
{error && <Text style={{ color: 'red' }}>{error.message}</Text>}
</View>
)
}
On this page