Skip to content
Serverless function to automatically update balance of investment accounts in YNAB
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.editorconfig
.gitignore
.travis.yml
LICENSE
README.md
package-lock.json
package.json
serverless.env.example.yml
serverless.yml
setup.png

README.md

sls-ynab-stock-updates

Build Status

Serverless function to automatically update investment account balances in YNAB.

Requirements

  • Node
  • NPM

Installation

npm install

Setup

There are a few preliminary steps that must be taken to start using this serverless function.

  1. Add information about your portfolio to the YNAB accounts you would like to be tracked.

Format: INVESTMENTS: {Stock Symbol} {Amount}, {Stock Symbol} {Amount}...

Example: INVESTMENTS: AAPL 191, MSFT 120

  1. Create a serverless.env.yml environment variable file and copy the existing variables from the example file.
cp serverless.env.example.yml serverless.env.yml
  1. Set the environment variables
  • YNAB_API_TOKEN: personal API token generated in the YNAB homepage.
  • AUTOMATIC_APPROVAL: should the automatic balance adjustment transactions be auto-approved? Useful to set this to true if you are running this function hourly/daily/weekly/etc and don't want to go through streams of transactions.
  • ALARM_EMAIL: what email should be notified if the function starts malfunctioning and throwing errors?
  1. Deploy the function
npm run deploy

Development

  1. Define necessary env variables in serverless.env.yml (example available in serverless.env.example.yml)

  2. Run (to run locally)

npm start

Deployment

If you wish to run this serverless function on a schedule (configured in serverless.yml file), then it must be deployed. This can be done by running the following command.

npm run deploy
You can’t perform that action at this time.