@ally.wtf/connect
v1.0.2
Published
Ally Connect Widget Library
Downloads
6
Readme
AllyConnect Usage Guide
AllyConnect is a JavaScript class designed to facilitate seamless integration of the AllyConnect widget into web applications. Follow the steps below to integrate and utilize AllyConnect in your project:
Installation
You can install AllyConnect via npm:
npm i @ally.wtf/connect
Usage
Import AllyConnect: Import the AllyConnect class into your JavaScript file.
let AllyConnect = require("@ally.wtf/connect");
Instantiate AllyConnect: Create a new instance of AllyConnect by providing your unique
appId
.const ally = new AllyConnect('your_app_id');
Open the Widget: Call the
openWidget()
method to launch the Ally Connect widget.ally.openWidget();
Handling Events: You can handle events emitted by the AllyConnect widget using the on() method. Supported events include
ready
,select_bank
,connecting
,connected
&auth_expired
.ally.on('connecting', (data) => { // Handle close event }); ally.on('connected', (data) => { // Handle close event }); ally.on('auth_expired', (data) => { // Handle close event });
Example
const AllyConnect = require('@ally.wtf/connect');
// Instantiate AllyConnect
const ally = new AllyConnect('your_app_id');
// Open the Widget
ally.openWidget();
// Handle close event
ally.on('close', (data) => {
console.log('Widget closed', data);
});
For more examples check here
Contributing
If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request on GitHub.
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Support
For any inquiries or assistance, contact [email protected].