1.0.2 • Published 9 months ago

use-pluggy-connect v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

use-pluggy-connect

React hook to integrate Pluggy Connect.

NPM JavaScript Style Guide

Install

npm install --save use-pluggy-connect

Usage

import React, { useCallback } from 'react'

import { usePluggyConnect } from 'use-pluggy-connect'

const App = () => {
  const handleEvent = useCallback((payload) => {
    console.log(`[Event]: ${payload}`)
  }, [])

  const { init, error, ready } = usePluggyConnect({
    url: 'https://connect.pluggy.dev',
    connectToken: 'eyJhbGciOiJSUzI1NiIsInR5cCI6IJ9...',
    onEvent: handleEvent,
  })

  if (!ready) {
    return <div>Loading...</div>
  }
  if (error) {
    return <div>Error: {error.message}</div>
  }
  return (
    <div>
      <button onClick={init}>Init</button>
    </div>
  )
}
export default App
1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago