Skip to content

mcky/mondo-sheets

Repository files navigation

mondo-sheets

Connect your Mondo to Google sheets.

Registers a webhook with mondo and posts your transactions to a spreadhseet.

Example spreadhseet

Usage

  1. Create a google sheet with row headers matching the keys you want imported to the sheet. All keys sent from the webhook can be found in the webhook documentation. (Only merchant_id from the merchant object is supported at the moment)

  2. Get your OAuth credentials from Mondo

  3. Follow the instructions in the google-spreadsheet for setting up a service account for use with google sheets.

  4. Set the environment variables below or in a .env file if testing locally. Run all commands prepended with NODE_ENV=development locally.

GOOGLE_CLIENT_EMAIL=
GOOGLE_PRIVATE_KEY=
GOOGLE_SHEET_KEY=

MONDO_CLIENT_ID=
MONDO_CLIENT_SECRET=
MONDO_USERNAME=
MONDO_PASSWORD=

PORT=
WEBHOOK_ORIGIN=*
WEBHOOK_URL=

  1. Run npm install to add dependencies
  2. Run npm run register-hook to register a webhook with the WEBHOOK_URL you provided
  3. Run npm start or NODE_ENV=development npm start locally
  4. Run npm run prefill to prefill the spreadsheet with all your past transactions

Scripts

npm run start - Start the server listening for webhooks
npm run prefill - Fetch all past transactions and add them to the sheet (don't have the sheet tab open when you're using this!) npm run list-hooks - List webhooks
npm run register-hook - Register a webhook for this application
npm run dedupe-hooks - Remove webhooks with duplicate URLs

Todo

  • Get the current account balance when a webhook is fired

Notes

The sheets API seems to silently fail if you try sending too many rows too fast. For now I've implimented a delay between adding rows.

I've removed account_balance for now as it appears on old transactions but not the webhook ones yet.

Thanks

Alex Robinson for his great mondo-bank API library

Darian Moody for his help with de-duping webhooks

About

Mondo to google sheets integration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published