This code was copied and adapted from: https://github.com/plaid/quickstart/tree/master/node
This project was built for personal finance purposes, all the code does is talks to Plaid API and write tokens to your local file system. If you decided to use it, please be sure to go through the code yourself to make sure it does what it says in case you don't feel safe entering your bank credentials.
-
Sign up for Plaid and apply for the development plan (It's free and limited to 100 items (i.e. banks)). You might need to wait to get approved.
-
Once approved, fill out the following in
.env
from your Plaid dashboard:PLAID_CLIENT_ID
PLAID_SECRET
PLAID_PUBLIC_KEY
-
Now you need to connect to your financial institutions to generate access tokens, run the following command:
npm run get-token <account_name> <output_token_path>
account_name
: is a name for the bank you want to connect, it's for your personal reference, so you can name it anything.output_token_path
: a path where to store the retrieved token, e.g:./token_chase.txt
.
What the command will do is:
Start a local server at http://localhost:3333 which you can visit in your browser and go through the authentication flow. Once you've linked the bank, its associated access token will be saved in the path you provided
<output_token_path>
.
This process needs to be repeated for each bank you want to connect. Make sure to run each with a differentaccount
name.
- After than you can use your access token, to talk with the Plaid API to retrieve your balance, transactions....