Create SCA Setup Element

createElement('scaSetup', options?)

Use this function to create an instance of an individual Element.

Parameters

typerequired'scaSetup'

The type of element you are creating.

optionsoptionalScaSetupElementOptions

Options for creating scaSetup Element.

Returns

ScaSetupElement | null
linkTypeScript
1import { createElement } from '@airwallex/components-sdk';
2
3const scaElement = await createElement('scaSetup', {
4 userEmail: 'replace-with-user-email',
5 prefilledMobileInfo: {
6 countryCode: 'replace-with-user-country-code', // e.g. "61" for country Australia
7 nationalNumber: 'replace-with-user-national-number', // e.g. "04XXXXXXXX" for country Australia
8 },
9});

ScaSetupElementOptions

Options for creating the SCA Setup Element.

userEmailrequiredstring

User’s email, used for two-factor authentication recovery in case the user forgets the passcode.

disableFullPageoptionalboolean

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.

localeoptional'en'

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.

prefilledMobileInfooptional

User’s mobile information, prefilled during the setup flow.

ScaSetupElement

Functions and external fields can be used in your integration flow with SCA Setup Element.

destroy()

Destroys the Element instance.

Returns

void
linkTypeScript
1element.destroy();

mount(domElement)

Mounts Element to your HTML DOM.

Parameters

domElementrequiredstring | HTMLElement

The container DOM element to mount the element.

Returns

void
linkTypeScript
1// There are two ways to mount element:
2// 1. call with container dom id
3element.mount('container-dom-id');
4
5// 2.find the created DOM in existing HTML and call with container DOM element
6const 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

void
linkTypeScript
1element.on('cancel', () => {
2 // Handle cancel event
3});

unmount()

Unmounts the Element. Note that the Element instance will remain.

Returns

void
linkTypeScript
1element.unmount();