aerosync-web-sdk
v2.0.3
Published
This WEB SDK provides an interface to load Aerosync-UI in javascript or typescript application. Securely link your bank account through your bank’s website. Log in with a fast, secure, and tokenized connection. Your information is never shared or sold.
Downloads
2,597
Readme
Aerosync Web SDK
This Web SDK provides an interface to load Aerosync-UI in Javascript/typescript application. Securely link your bank account through your bank’s website. Log in with a fast, secure, and tokenized connection. Your information is never shared or sold.
NPM Versioning Notice
For all Aeropay integrations, please use the 1.1.0 Version of our web npm package. Any versions 2.0 and later are still in beta and may be unstable. Version 2.0 and above are intended for Aerosync-only integrations. (not using Aeropay to process payments)
Installation
npm i aerosync-web-sdk
Usage
Create HTML element reference
<!--button to lauch Aerosync widget-->
<button
id="openBank"
class="button"
role="button"
@click="openAerosyncWidget()"
>
Connect Bank
</button>
<!--The id 'widget' allows Aerosync to access the element where the widget will be launched -->
<div id="widget"></div>
Import and configure Aerosync widget
/**
* Integrate AeroSync UI AddBank
*/
import { openWidget, widget } from "aerosync-web-sdk";
function openAerosyncWidget() {
let token: string = ""; // Signature to instigate Aerosync services
let deeplink: string = ""; // Unique URL that points to the specific page within the mobile app
let consumerId: string = ""; // Unique ID that represents the merchant for customization
let handleMFA: boolean = false; // if true then handle the additional MFA workflow for balance refresh
let domain: string = ""; // Merchant host name eg: google.com
let jobId: string = ""; // Unique ID for current job
let userId: string = ""; // Unique ID for user
let widgetRef: widget = openWidget({
id: "widget",
iframeTitle: "Connect",
environment: "production", // staging, production
token: token,
style: {
width: "375px",
height: "688px",
bgColor: "#000000",
opacity: 0.7,
},
deeplink: deeplink,
handleMFA: handleMFA,
domain: domain,
jobId: jobId,
userId: userId,
consumerId: consumerId,
onEvent: function (event: object, type: string) {
console.log("onEvent", event, type);
},
onLoad: function () {
console.log("onLoad");
},
onSuccess: function (event: object) {
console.log("onSuccess", event);
},
onClose: function () {
console.log("onClose");
},
onError: function (event: object) {
console.log("onError", event);
},
});
widgetRef.launch();
}
Readme.io document
For more information check the comlete guide here: https://api-aerosync.readme.io/docs/web-npm-sdk
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
This project is licensed under the MIT License.