react-mono-js
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

Mono for React

This is a React Package that helps you integrate Mono - https://withmono.com/ easily

Install

npm install --save react-mono-js
# or 
yarn add react-mono-js

Usage

import React from 'react';
import { MonoButton, useMono } from 'react-mono-js';
 
export default function App() {
  const config = {
    public_key: 'YOUR_CONNECT_PUBLIC_KEY',
    onClose: () => {},
    onSuccess: (response) => {
      console.log(response.code);
 
      /**
        response : { "code": "code_xyz" }
        you can send this code back to your server to get this
        authenticated account and start making requests.
      */
    },
  };
 
  const handleMono = useMono({ public_key: 'YOUR_CONNECT_PUBLIC_KEY' });
 
  return (
    <div className="App">
      <h1>React Wrapper for Mono enrollments</h1>
      <h2>Check it out!</h2>
 
      <button
        onClick={() =>
          handleMono({
            onClose: () => null,
            onSuccess: (response) => {
              console.log(response.code);
            },
          })
        }
      >
        Connect bank with Mono
      </button>
 
      <MonoButton {...config} text="Connect bank with Mono!" />
    </div>
  );
}

Please checkout Mono Documentation for more explanation

Follow on Twitter @somtougeh

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Package Sidebar

Install

npm i react-mono-js

Weekly Downloads

43

Version

1.1.2

License

MIT

Unpacked Size

22.6 kB

Total Files

21

Last publish

Collaborators

  • somtougeh