1.1.0 • Published 6 months ago

aerosync-web-sdk v1.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
6 months ago

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.

2.0.4-beta.0

6 months ago

2.0.3

8 months ago

2.0.2

9 months ago

2.0.1

9 months ago

2.0.0

9 months ago

1.1.0

10 months ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago