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, init } from '@airwallex/components-sdk';23await init({4 env: 'prod',5 authCode: 'replace-with-auth-code',6 codeVerifier: 'replace-with-code-verifier',7 clientId: 'replace-with-client-id',8 enabledElements: ['risk'],9});1011const scaElement = await createElement('scaManagement', {12 userEmail: 'replace-with-user-email',13 prefilledMobileInfo: {14 countryCode: 'replace-with-user-country-code', // e.g. "61" for country Australia15 nationalNumber: 'replace-with-user-national-number', // e.g. "04XXXXXXXX" for country Australia16 },17});
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.
Type Parameters
A generic type for event codes. This is typically inferred automatically and does not need to be specified explicitly.
Parameters
The callback function that will be called when the event occurs.
Returns
void1element.on('cancel', () => {2 // Handle cancel event3});