1.0.1 • Published 8 years ago
react-native-plaid v1.0.1
react-native-plaid
Plaid Link implementation for React Native using a Webview and Plaid Link.

Documentation
Installation
npm install --save react-native-plaidSetup
Environment Variables
Environment Variables will need to be set for react-native-plaid to work. See react-native-config
to learn more on how to use environment variables.
In your .env file, use the following variables:
| Variable | Type | default value | Description |
|---|---|---|---|
| PLAID_LINK_PUBLIC_KEY (required) | string | Public identifier that is used to initialize Plaid Link | |
| PLAID_LINK_ENV | string | sandbox | API environment |
| PLAID_LINK_PRODUCT | string | auth | Plaid Product |
| PLAID_LINK_CLIENT_NAME | string | Plaid Test | |
| PLAID_LINK_WEBHOOK | string | ||
| PLAID_LINK_TOKEN | string | ||
| PLAID_LINK_API_VERSION | string | v2 |
For more information please read their docs
Get Plaid API key
- Go to Plaid dashboard and
Sign in. - Go to Keys and copy your Plaid public_key
Usage
Once you've install the library and setup the environment variables, you'll want to make it available to your app by importing it:
import PlaidLinkView from 'react-native-plaid';Displaying the Plaid Link is as simple as:
render() {
return (
<PlaidLinkView
onMessage={data => console.log(data)}
onExit={() => console.log("Exit")}
onError={e => {console.log(e)}}
/>
);
}API
| Prop | Type | defaultValue | Description |
|---|---|---|---|
| onMessage (required) | function | Returns authentication data. | |
| onExit | function | Execute any action at exit to Plaid. | |
| onError | function | Returns any error on WebView or Plaid. | |
| publicKey | string | ||
| env | string | ||
| product | string | ||
| clientName | string | ||
| webhook | string | ||
| token | string | ||
| selectAccount | boolean | ||
| apiVersion | string | ||
| WebView props | - | - | - |
Returned data object
{
"institution": {
"name": "Chase",
"institution_id": "ins_3"
},
"account": {
"id": null,
"name": null,
"type": null,
"subtype": null
},
"account_id": null,
"accounts": [],
"link_session_id": "c737a192-270f-4c45-adb7-6358abca8c0f",
"public_token": "public-sandbox-5658fef9-260c-4848-b443-868413ae1521"
}Contributions of any kind welcome!