Phone number validation / verify (OTP)

Looking for a possible solutions to validate phone numbers in the form (OTP verification). We are working with Make and I found out Twilio Verify. Does anyone here have implemented possibly other solution(s) and can recommend? Thank you!

Twilio is good, but there are others like Nexmo, Plivo, MessageBird as well. Really anything that can send an SMS will do the job. Make sure to consider where your users are located because each country has different SMS services.

I’d recommend handling it as a multi-step form and verifying the phone number separately so that you can deal with retries, etc in a separate UX, and then progress to capturing the rest of the form data. You simply have

  • a field for the phone
  • a button to send the code
  • a field for the SMS code
  • a button to verify ( can also auto-verify when e.g. all 6 digits are entered )

Unless you have significant security needs, I’d generate that code client side in JS when the “send code” button is clicked, and then verify it client side when the verify button is clicked. That simplifies the server side to a single automation, which just sends the code in an SMS.

Also, do some basic validation on the phone number format beforehand. USA is easiest, other countries often have variable length numbers.

If you’re doing this internationally you may want to use several services to minimize costs. I’d add a country code prefix picker to help you identify that and to validate the phone number format for each country.

You’ll need a form validation solution as well that handles custom validations. On successful verification, the verify button code can populate a hidden field ( e.g. name = verified_phone ) with the formatted, verified phone number, but you will need to display a validation error message separately from that hidden field if the user tries to submit the form without the phone having been verified.