JSPM

  • Created
  • Published
  • Downloads 294654
  • Score
    100M100P100Q178910F
  • License MIT

A React component for Plaid Link

Package Exports

  • react-plaid-link

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-plaid-link) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-plaid-link npm version

A simple React component for easy integration with the Plaid Link drop-in module

Install

npm install react-plaid-link --save

Example Usage

import React, { Component } from 'react'
import PlaidLink from 'react-plaid-link'

class App extends Component {
  handleOnSuccess(token, metadata) {
    // send token to client server
  }
  handleOnExit() {
    // handle the case when your user exits Link
  }
  render() {
    return (
      <PlaidLink
        clientName="Your app name"
        env="sandbox"
        product={["auth", "transactions"]}
        publicKey="PLAID_PUBLIC_KEY"
        onExit={this.handleOnExit}
        onSuccess={this.handleOnSuccess}>
        Open Link and connect your bank!
      </PlaidLink>
    )
  }
}
export default App

All Props

Please refer to the official Plaid Link docs for a more holistic understanding of the various Link options.

<PlaidLink
  clientName="Your app name"
  env="sandbox"
  key={PLAID_PUBLIC_KEY}
  product={['auth', 'transactions']}
  apiVersion={'v1' || 'v2'}
  token={'public-token-123...'}
  selectAccount={true} // deprecated – use https://dashboard.plaid.com/link
  webhook="https://webhooks.test.com"
  onEvent={this.handleOnEvent}
  onExit={this.handleOnExit}
  onLoad={this.handleOnLoad}
  onSuccess={this.handleOnSuccess}
  style={{width: '100px'}}
  countryCodes={['US', 'CA']}
  language="en"
  user={{legalName: 'Jane Doe', emailAddress: 'jane@example.com'}}
  webhook="https://example.com/plaid-webhook"
  oauthNonce={'627ddf99...'}
  oauthRedirectUri="https://example.com/plaid-oauth-callback"
  oauthStateId={'1b748f9e...'}
  paymentToken={'payment-token-sandbox-1b748f9e...'}>
  Open Link and connect a bank account to Plaid
</PlaidLink>

Contributing

Run tests:

make test

Development

# install dependencies
make setup

# run a local server
make start

# open localhost:3000