npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ngx-mono

v0.0.3

Published

> ngx-mono is an angular library to securely and quickly link bank accounts to Mono from within your app. It is built around Mono Connect.js. Mono Connect is a drop-in framework that handles connecting a financial institution to your app.

Downloads

9

Readme

NGX-MONO

ngx-mono is an angular library to securely and quickly link bank accounts to Mono from within your app. It is built around Mono Connect.js. Mono Connect is a drop-in framework that handles connecting a financial institution to your app.

Visit Mono Docs for the detailed documentation.

REQUIREMENTS

Node 10 or higher

INSTALLATION

To install the latest version of ngx-mono, simply run the command

npm install --save ngx-mono

USAGE

1. Import the module

Import the library in your module:

import { NgxMonoModule } from 'ngx-mono'
2. Implement in your project
<ngx-mono
    [options]="options"
    (onSuccess)="onSuccess($event)"
>Connect</ngx-mono>
import { IMonoOptions } from 'ngx-mono'

  options:IMonoOptions = {
    key: <public_key>,
    data: {
      type: 'one-time-debit', // recurring-debit or one-time-debit
      amount: 150000, //amount in kobo
      description: "payment for light bill"
    }
  }

  onSuccess(data:any){
    console.log(data);
  }

OPTIONS

| S/N | Option | Data Type | Required | Description | | |-----|------------------|-----------|----------|-------------------------------------------------------------------------------------------------------------------|---| | 1 | key | string | yes | The public key of your app. It can be gotten from the Mono dashboard. | | | 2 | reauthToken | string | no | This is only applicable to token re-authentication. Once this is present, a token re-authentication is initiated. | | | 3 | scope | string | no | This should be set to ‘payments’ when integrating to Direct Debit | | | 4 | data.type | string | no | Used when integrating to Direct Debit. Possible values are ‘one-time-debit’ and ‘recurring-debit’. | | | 5 | data.amount | integer | no | Amount to be debited in kobo. | | | 6 | data.description | string | no | Details of what payment is being made for. | |

CALLBACKS

| | Callback | Required | Description | |---|-----------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 1 | onSuccess | yes | Called after the successful onboarding of an account. It should take a single String argument containing the token that can be exchanged for an account id. | | 2 | onLoad | no | Called when the widget has been mounted unto the DOM. | | 3 | onClose | no | Called when a user has specifically exited the Mono Connect flow (i.e. the widget is not visible to the user). It does not take any arguments. | | 4 | onEvent | no | Called when certain events in the Mono Connect flow have occurred, for example, when the user selected an institution. This enables your application to gain further insight into the Mono Connect onboarding flow. |

EVENTS

Below are the possible events that can be raised by the onEvent callback: | Event Name | Description | |--------------------|-----------------------------------------------------------------------------------------------------| | OPENED | Triggered when the user opens the Connect Widget. | | EXIT | Triggered when the user closes the Connect Widget. | | INSTITUTION_SELECTED | Triggered when the user selects an institution. | | AUTH_METHOD_SWITCHED | Triggered when the user changes authentication method from internet to mobile banking, or vice versa. | | SUBMIT_CREDENTIALS | Triggered when the user presses Log in. | | ACCOUNT_LINKED | Triggered when the user successfully links their account. | | ACCOUNT_SELECTED | Triggered when the user selects a new account. | | ERROR | Triggered when the widget reports an error. |

SAMPLE SNIPPETS

1. Link Account

This is to link a user's account

<ngx-mono
    [options]="options"
    (onSuccess)="onSuccess($event)"
>Connect</ngx-mono>
import { IMonoOptions, IEventOptions } from 'ngx-mono';
 options:IMonoOptions = {
   key: '<public_key>'
 }
onSuccess(data:IEventOptions){
    console.log(data);
}

2. Reauthorization

<ngx-mono
    [options]="options"
    (onSuccess)="onSuccess($event)"
>Re-authorize</ngx-mono>
options:IMonoOptions = {
key: '<public_key>',
reauthToken: 'code_tPL0FVbsFuCqrBfMV4Vh'
}
onSuccess(data:IEventOptions){
    console.log(data);
}

3. Direct Debit

<ngx-mono
    [options]="options"
    (onSuccess)="onSuccess($event)"
>Direct debit</ngx-mono>
  options:IMonoOptions = {
    key: '<public_key>',
    scope: 'payments',
    data: {
       type: 'one-time-debit', // recurring-debit or one-time-debit
       amount: 150000, //amount in kobo
       description: "payment for electricity"
     }
  }

CONTRIBUTING

Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.

Star

I'd love you star this repo. Also follow me on twitter

License

The MIT License (MIT). Please see License File for more information.