Skip to content

Documentation / js-sdk-core / validatePhoneNumber

Function: validatePhoneNumber()

validatePhoneNumber(phoneNumber, countryCode): boolean

Do a lightweight validation of phone number. We'll do much heavier validation on the backend, so this just needs to be sensible. This hints a default country code of the US/+1, but will work for international numbers, provided they give the country code in the number (ie +49 123123123).

Parameters

phoneNumber: string

countryCode: CountryCode

Returns

boolean