Create SCA Management Element
createElement('scaManagement', options?)
Use this function to create an instance of an individual Element.
Parameters
The type of element you are creating.
Options for creating scaManagement Element.
Returns
ScaManagementElement | null1import { createElement } from '@airwallex/components-sdk';23const scaElement = await createElement('scaManagement', {4 userEmail: 'replace-with-user-email',5 prefilledMobileInfo: {6 countryCode: 'replace-with-user-country-code', // e.g. "61" for country Australia7 nationalNumber: 'replace-with-user-national-number', // e.g. "04XXXXXXXX" for country Australia8 },9});
ScaManagementElementOptions
Options for creating the SCA Management Element.
User’s email, used for two-factor authentication recovery in case the user forgets the passcode.
By default, the reset passcode page is displayed in a full-page layout. Set this field to true to disable the full-page layout and use an embedded layout instead.
The locale for the Element, applied to Element UI strings and error messages. If this field is not provided, the locale configured in init() will be used.
User’s mobile information, prefilled during the setup flow.
ScaManagementElement
Functions and external fields can be used in your integration flow with SCA Management Element.
mount(domElement)
Mounts Element to your HTML DOM.
Parameters
The container DOM element to mount the element.
Returns
void1// There are two ways to mount element:2// 1. call with container dom id3element.mount('container-dom-id');45// 2.find the created DOM in existing HTML and call with container DOM element6const containerElement = document.getElementById("container-dom-id");7element.mount(containerElement);
on(eventCode, handler)
Listen to Element events.
Parameters
The event code to listen for.
The callback function that will be called when the event occurs.
Returns
void1element.on('cancel', () => {2 // Handle cancel event3});