JavaScript: Create a challenge

Prepares a challenge used to verify that a user has access to a MFA factor.

Parameters

Examples

Create a challenge for a factor

const \{ data, error \} = await supabase.auth.mfa.challenge(\{
  factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225'
\})

Create a challenge for a phone factor

const \{ data, error \} = await supabase.auth.mfa.challenge(\{
  factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',
\})

Create a challenge for a phone factor (WhatsApp)

const \{ data, error \} = await supabase.auth.mfa.challenge(\{
  factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',
  channel: 'whatsapp',
\})