1.1.2 • Published 10 months ago

use-pluggy-connect v1.1.2

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

use-pluggy-connect

React hook to integrate Pluggy Connect.

NPM JavaScript Style Guide

Install

npm install --save use-pluggy-connect

or

pnpm install --save use-pluggy-connect

or

yarn add use-pluggy-connect

or

bun install --save use-pluggy-connect

Usage

React

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

Nextjs

'use client'

import usePluggyConnect from 'use-pluggy-connect'

export default function OpenPluggyButton() {
  const { init } = usePluggyConnect({
    connectToken:
      '...',
  })

  return <button onClick={init}>Open Pluggy</button>
}

TODOS:

  • Add tests
  • Improve examples
1.1.1

10 months ago

1.1.0

10 months ago

1.1.2

10 months ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago