showPhoneNumberEditor
client.showPhoneNumberEditor({ container: HTMLElement|id, accessToken: string, // Optional arguments showLabels: boolean, countryCode: string, onReady: function, theme: object, i18n: object, phoneNumberOptions: object })
Description
Show the widget allowing the current profile to change his phone number after authentication.
The SMS feature must be enabled on your ReachFive account.
Examples
const accessToken = // Here paste the authorization token of the profile retrieved after login
client.showPhoneNumberEditor({
container: 'phone-number-editor-container',
accessToken,
showLabels: true,
countryCode: 'US',
onReady: instance => {
// Destroy the widget
// if (...) instance.destroy()
},
theme: {
primaryColor: '#274890',
borderRadius: '#374890'
},
i18n: {
'phoneNumberEditor.verification.intro': 'Please enter the verification code we sent you by SMS.',
'phoneNumber': 'Your new phone number'
}
})
Parameters
The DOM element or the |
|||||||||
The authorization credential JSON Web Token (JWT) used to access the ReachFive API, less than five minutes old. |
|||||||||
Boolean for whether the signup form fields' labels are displayed on the login view. Defaults to |
|||||||||
The ISO country code useful to format phone numbers. Defaults to the predefined country code in your account settings or |
|||||||||
Callback function called after the widget has been successfully loaded and rendered inside the container. The callback is called with the widget instance. |
|||||||||
The options to set up to customize the appearance of the widget. Below is an example of some of the theme attributes. For a full list, see theme attributes.
|
|||||||||
Widget labels and error messages to override. Falls back to the default wordings in
|
|||||||||
Object that lets you set display options for the phone number field. Options
|
theme
attributes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|