showProfileEditor
client.showProfileEditor({ container: HTMLElement|id, accessToken: string, fields: Field[], // Optional arguments showLabels: boolean, countryCode: string, redirectUrl: string, onReady: function, onSuccess: function, onError: function, theme: object, i18n: object, })
Examples
import { ErrorResponse } from '@reachfive/identity-ui'
const accessToken = // Here paste the authorization token of the profile retrieved after login
// The SMS feature is disabled on the ReachFive account
client.showProfileEditor({
container: 'profile-editor-container',
accessToken,
fields: [
'given_name',
'family_name',
'phone_number',
'gender',
'birthdate',
'consents.newsletter',
'custom_fields.loyalty_card_number'
],
showLabels: true,
countryCode: 'US',
onReady: instance => {
// Destroy the widget
// if (...) instance.destroy()
},
onSuccess: () => {
console.log("Profile updated with success!")
},
onError: (error: ErrorResponse) => {
console.error(error)
},
theme: {
primaryColor: '#274890',
borderRadius: '#374890'
},
i18n: {
'save': 'Save your profile\'s data'
}
})
Parameters
The DOM element or the |
|||||||||
The profile’s access token. |
|||||||||
List of the fields to display in the form.
Note on consents
Any consent used in the Archived consent with no user history/previously rejected
Previously accepted consent
|
|||||||||
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 |
|||||||||
The URL sent in the email to which the user is redirected. This URL must be whitelisted in the |
|||||||||
Callback function called after the widget has been successfully loaded and rendered inside the container. The callback is called with the widget instance. |
|||||||||
Callback function called when the request was successful. |
|||||||||
Callback function called when the request has failed. |
|||||||||
The options to set up to customize the appearance of the widget.
|
|||||||||
Widget labels and error messages to override. Falls back to the default wordings in
|