JavaScript: Sign in a user through OTP

Log in a user using magiclink or a one-time password (OTP).

Parameters

Examples

Sign in with email

const \{ data, error \} = await supabase.auth.signInWithOtp(\{
  email: 'example@email.com',
  options: \{
    emailRedirectTo: 'https://example.com/welcome'
  \}
\})

Sign in with SMS OTP

const \{ data, error \} = await supabase.auth.signInWithOtp(\{
  phone: '+13334445555',
\})

Sign in with WhatsApp OTP

const \{ data, error \} = await supabase.auth.signInWithOtp(\{
  phone: '+13334445555',
  options: \{
    channel:'whatsapp',
  \}
\})