SomtoUgeh / react-mono

πŸ’³ πŸ“¦ πŸ’° React package for implementing Mono enrollment easily

Home Page:https://www.npmjs.com/package/react-mono-js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mono for React

This is a React Package that helps you integrate Mono - https://mono.co/ 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 @ugehsomto

License

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

About

πŸ’³ πŸ“¦ πŸ’° React package for implementing Mono enrollment easily

https://www.npmjs.com/package/react-mono-js

License:MIT License


Languages

Language:TypeScript 82.8%Language:JavaScript 17.2%