Javascript Reference v1.0

Send a one-time passcode

Sends a mobile OTP via SMS. Will register the account if it doesn't already exist

  • Requires a service_role key.
  • This function should only be called on a server. Never expose your service_role key in the browser.
Parameters
    phone
    REQUIRED
    string

    The user's phone number WITH international prefix

    options
    Optional
    object

const { data: user, error } = await supabase.auth
  .api
  .sendMobileOTP('12345879')