showPasswordless
client.showPasswordless({ container: HTMLElement|id, // Optional arguments authType: string, showSocialLogins: boolean, socialProviders: string[], showIntro: boolean, countryCode: string, auth: object, onReady: function, onSuccess: function, onError: function, theme: object, i18n: object, recaptcha_enabled: boolean, recaptcha_site_key: string, phoneNumberOptions: object })
Examples
client.showPasswordless({
container: 'passwordless-container',
showSocialLogins: true,
socialProviders: ['facebook', 'google'],
auth: {
redirectUri: 'http://localhost:3000/local-sandbox/auth-callback'
},
onReady: instance => {
// Destroy the widget
// if (...) instance.destroy()
},
onSuccess: () => {
console.log("Success!")
},
onError: (error: ErrorResponse) => {
console.error(error)
},
theme: {
primaryColor: '#274890',
borderRadius: '25',
socialButton: {
inline: true
}
},
i18n: {
'passwordless.intro': 'Enter your email to sign in.'
}
})
client.showPasswordless({
container: 'passwordless-container',
showSocialLogins: true,
socialProviders: ['facebook', 'google'],
authType: 'sms',
countryCode: 'US',
onReady: instance => {
// Destroy the widget
// if (...) instance.destroy()
},
onSuccess: () => {
console.log("Success!")
},
onError: (error: ErrorResponse) => {
console.error(error)
},
theme: {
primaryColor: '#274890',
borderRadius: '25',
socialButton: {
inline: true
}
},
i18n: {
'passwordless.sms.intro': 'Enter your phone number to sign in.',
}
})
Parameters
The DOM element or the |
|||||||||||||||||||||||||||||||||
The passwordless auth type ( Defaults to |
|||||||||||||||||||||||||||||||||
Show the social login buttons. Defaults to |
|||||||||||||||||||||||||||||||||
Lists the available social providers. This is an array of strings. If you pass an empty array, social providers are not displayed. You can also specify variants for a provider as a key:value pair:
|
|||||||||||||||||||||||||||||||||
Show the introduction text. Defaults to |
|||||||||||||||||||||||||||||||||
The ISO country code useful to format phone numbers. Defaults to the predefined country code in your account settings or |
|||||||||||||||||||||||||||||||||
List of authentication options
|
|||||||||||||||||||||||||||||||||
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. You can override this function with custom logic if desired: client.showPasswordless example
|
|||||||||||||||||||||||||||||||||
Callback function called when the request has failed. See our full list of SDK and API errors. You can override this function with custom logic if desired: client.showPasswordless example
|
|||||||||||||||||||||||||||||||||
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 Using the
|
|||||||||||||||||||||||||||||||||
Boolean that specifies whether reCAPTCHA is enabled or not. |
|||||||||||||||||||||||||||||||||
The SITE key that comes from your reCAPTCHA setup. This must be paired with the appropriate secret key that you received when setting up reCAPTCHA. |
|||||||||||||||||||||||||||||||||
Object that lets you set display options for the phone number field. Options
|
theme
attributes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UI labels
ReachFive has a set of default labels for UI components and fields. This includes a range of things from names and sign up fields to verification code fields, and more.
Using the i18n
field, you can override these default labels to suit your particular setup.
client.showAuth({
i18n: {
email: 'Your email address, por favor.'
},
...
})