For AI agents: a documentation index is available at /llms.txt. A markdown version of this page is available at the same URL with .md appended (or via Accept: text/markdown).
Skip to main content

useManageMFA

Hook to open the MFA management screen for a user who has already enabled MFA.

Import​

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

Usage​

import { useManageMFA, useWeb3AuthUser } from '@web3auth/react-native-sdk'
import { Button, Text, View } from 'react-native'

function ManageMFAButton() {
const { manageMFA, loading, error } = useManageMFA()
const { isMFAEnabled } = useWeb3AuthUser()

if (!isMFAEnabled) return null

return (
<View>
<Button
title={loading ? 'Opening MFA settings…' : 'Manage MFA'}
disabled={loading}
onPress={() => manageMFA()}
/>
{error && <Text>{error.message}</Text>}
</View>
)
}

Return type​

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

manageMFA​

() => Promise<void>

Opens the account dashboard in the in-app browser, where the user can add, update, or remove MFA factors. If MFA isn't enabled yet, manageMFA sets error; call enableMFA first.

loading​

boolean

true while the MFA management flow is in progress.

error​

Web3authRNError | null

Error from the most recent manageMFA call, or null.