# react-native-plaid

> Plaid support for React Native apps.

Latest version **1.0.1** (published 2017-12-26) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install react-native-plaid
pnpm add react-native-plaid
yarn add react-native-plaid
bun add react-native-plaid
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-12-26 |
| First published | 2017-12-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | JC Carrillo |
| Maintainers | mateoguzmana, jccarrillo |
| Keywords | react, react-native, plaid, plaid-link, webview, ios, android, react-component |

## Links

- npm: https://www.npmjs.com/package/react-native-plaid
- Repository: https://github.com/DVDENDO/react-native-plaid
- Homepage: https://github.com/DVDENDO/react-native-plaid#readme
- Issues: https://github.com/DVDENDO/react-native-plaid/issues
- npm.io page: https://npm.io/package/react-native-plaid

## Dependencies (1)

- [object.omit](https://npm.io/package/object.omit.md) ^3.0.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2017-12-26
- 1.0.0 — 2017-12-22

## README

# react-native-plaid

[![react-native version](https://img.shields.io/badge/react--native-0.20-green.svg?style=flat-square)](http://facebook.github.io/react-native/releases/0.20)
[![npm version](https://img.shields.io/npm/v/react-native-plaid.svg?style=flat-square)](https://www.npmjs.com/package/react-native-plaid)

Plaid Link implementation for React Native using a [Webview](https://plaid.com/docs/quickstart/#webview-integration) and
[Plaid Link](https://blog.plaid.com/announcing-a-new-mobile-experience-for-link/).

![react-native-plaid](https://media.giphy.com/media/l49JLZaO0trYPizS0/giphy.gif)

## Documentation

- [Installation](https://github.com/DVDENDO/react-native-plaid#installation)
- [Setup](https://github.com/DVDENDO/react-native-plaid#setup)
- [Usage](https://github.com/DVDENDO/react-native-plaid#usage)

## Installation
```shell
npm install --save react-native-plaid
```
## Setup

### Environment Variables

`Environment Variables` will need to be set for `react-native-plaid` to work. See [react-native-config](https://github.com/luggit/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](https://plaid.com/docs/quickstart/#api-environments) |
| **PLAID_LINK_PRODUCT**                                                     | `string`   | `auth`        | [Plaid Product](https://plaid.com/docs/quickstart/#products-overview)  |
| 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](https://plaid.com/docs/quickstart/#accessing-item-data)

#### Get Plaid API key

* Go to [Plaid dashboard](https://dashboard.plaid.com/signin) and `Sign in`.
* Go to [Keys](https://dashboard.plaid.com/account/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:

```js
import PlaidLinkView from 'react-native-plaid';
```

Displaying the Plaid Link is as simple as:

```js
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](https://facebook.github.io/react-native/docs/webview.html) | -          | -            | -                                          |

#### Returned data object

```json
{
  "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!

---
_Source: https://npm.io/package/react-native-plaid · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
