https://github.com/bradymholt/ynab-api-webhooks
Webhooks for the YNAB API
https://github.com/bradymholt/ynab-api-webhooks
ynab ynab-api
Last synced: 7 days ago
JSON representation
Webhooks for the YNAB API
- Host: GitHub
- URL: https://github.com/bradymholt/ynab-api-webhooks
- Owner: bradymholt
- Created: 2020-01-27T15:42:13.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-27T18:02:37.000Z (almost 4 years ago)
- Last Synced: 2025-03-29T06:51:11.267Z (28 days ago)
- Topics: ynab, ynab-api
- Language: TypeScript
- Size: 31.3 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# YNAB API Webhooks
Webhooks for the YNAB API. This application sends changes on a YNAB budget to a URL.
Each time this application runs, it will issue a [Delta Request](https://api.youneedabudget.com/#deltas) to the YNAB API and if changes are detected, it will POST those changes to the URL specified with the `WEBHOOK_URL` environment variable.
The application is not intended to be run as a server but invoked on a recurring basis from a scheduler like cron or Heroku Scheduler.
## Setup
### Local (Docker)
```
export YNAB_API_TOKEN=123 WEBHOOK_URL=https://mydomain.com/ynab-webhook-receive
docker-compose up --build --exit-code-from app
```### Heroku
The `heroku.yml` manifest file is used to define a Heroku application stack. The `run` command in heroku.yml will reference the `SCHEDULE_INTERNAL_SECONDS` environment variable (default: 30) and run this app on an internal in the Heroku environment.
**Provisioning (one time)**
```
heroku create ynab-api-webhooks --manifest
heroku config:set YNAB_API_TOKEN=123 WEBHOOK_URL=https://mydomain.com/ynab-webhook-receive
```**Deploying**
```
git push heroku master
heroku scale app=1
```## Environment Variables
- **YNAB_API_TOKEN** - The [YNAB API access token](https://api.youneedabudget.com/#personal-access-tokens). (**required**)
- **WEBHOOK_URL** - The URL to post changes to. (**required**)
- **BUDGET_ID** - The YNAB budget id to monitor. (*default: "last-used"*)
- **REDIS_URL** - The Redis server URL to connect to Redis. (*default: "redis://localhost"*)