Skip to main content

sendMobileOTP()

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

Parameters

  • phonerequiredstring

    The user's phone number WITH international prefix

  • optionsrequiredobject

    No description provided.

      Properties
    • captchaTokenoptionalstring

      No description provided.

    • shouldCreateUseroptionalboolean

      No description provided.

Notes

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

Examples

Basic example.

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