redcap3000 / plaid_node_quickstart

The experiments with the provided Plaid quickstart example in node using express.js and ejs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Quickstart for plaid-node

To run this application locally, first install it and then run either of the flows described below. Additionally, please also refer to the Quickstart guide.

Why

I wanted to get comfortable with Plaid for use with a small project with limited users (less than 10.) The quickstart has a lot, but the front end is too jquery for my tastes. The backend is missing a few calls, such as refreshToken and is probably a little too mouthy about enviornment variables.

Modifications

refreshToken - invalidates and returns new token (mostly for testing purposes at this moment)

Plans

Minimize jquery code, advanced visualizations, ability to send date parameters for applicable products. Coinbase-pro api integration

Installing the quickstart app

git clone https://github.com/plaid/quickstart.git
cd quickstart/node
npm install

The canonical flow

# Start the Quickstart with your API keys from the Dashboard
# https://dashboard.plaid.com/account/keys
#
# PLAID_PRODUCTS is a comma-separated list of products to use when
# initializing Link. Note that this list must contain 'assets' in
# order for the app to be able to create and retrieve asset reports.

PLAID_CLIENT_ID='CLIENT_ID' \
PLAID_SECRET='SECRET' \
PLAID_PUBLIC_KEY='PUBLIC_KEY' \
PLAID_ENV='sandbox' \
PLAID_PRODUCTS='transactions' \
PLAID_COUNTRY_CODES='US,CA,GB,FR,ES' \
node index.js

# Go to http://localhost:8000

The OAuth redirect flow

Some European institutions require an OAuth redirect authentication flow, where the end user is redirected to the bank’s website or mobile app to authenticate. For this flow, you should provide two additional configuration parameters, PLAID_OAUTH_NONCE and PLAID_OAUTH_REDIRECT_URI.

# You will need to whitelist the PLAID_OAUTH_REDIRECT_URI for
# your client ID through the Plaid developer dashboard at
# https://dashboard.plaid.com/team/api.
#
# Set PLAID_OAUTH_NONCE to a unique identifier such as a UUID.
# The nonce must be at least 16 characters long.
#
# Start the Quickstart with your API keys from the Dashboard
# https://dashboard.plaid.com/account/keys
#
# PLAID_PRODUCTS is a comma-separated list of products to use when
# initializing Link.

PLAID_CLIENT_ID='CLIENT_ID' \
PLAID_SECRET='SECRET' \
PLAID_PUBLIC_KEY='PUBLIC_KEY' \
PLAID_ENV='sandbox' \
PLAID_PRODUCTS='transactions' \
PLAID_COUNTRY_CODES='GB' \
PLAID_OAUTH_REDIRECT_URI='http://localhost:8000/oauth-response.html' \
PLAID_OAUTH_NONCE='nice-and-long-nonce' \
node index.js

# Go to http://localhost:8000

About

The experiments with the provided Plaid quickstart example in node using express.js and ejs.


Languages

Language:JavaScript 64.7%Language:HTML 29.5%Language:CSS 5.8%