aerosync-web-sdk
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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.

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.

Readme

Keywords

Package Sidebar

Install

npm i aerosync-web-sdk

Weekly Downloads

695

Version

1.1.0

License

ISC

Unpacked Size

33.6 kB

Total Files

8

Last publish

Collaborators

  • cory-from-aeropay
  • aerosync-bank-link