A cron job running serverless on Cloudflare Workers.
This project uses Nordigen to connect to a bank account and searches for a specific transaction regex, alerting on Discord when this happens.
This project runs on Cloudflare Workers. You need a Cloudflare API token.
Use the Edit Cloudflare Workers
template and add a new rule:
Account | D1 | Edit
Nordigen connects to your Open Banking-compatible bank account.
Sign up and follow the quickstart guide: https://nordigen.com/en/account_information_documenation/integration/quickstart_guide/
Save the account ID from step 5, you will need it later.
In order to send notifications, we currently only support Discord Webhooks.
-
Create a
.env
file in the root of the repository with the Cloudflare API Token and Account ID:CLOUDFLARE_API_TOKEN=<token> CLOUDFLARE_ACCOUNT_ID=<account_id>
-
Create a
.dev.vars
file in the root of the repository with the following content:NORDIGEN_SECRET_ID=<secret> NORDIGEN_SECRET_KEY=<secret> NORDIGEN_ACCOUNT_ID=<account_id> DISCORD_URL=<discord-webhook-url>
-
Create a
.notify-patterns.json
file with the transaction patterns to notify:[ { "name": "salary", "pattern": "Weyland-Yutani" }, { "name": "mortgage", "pattern": "Goliath National Bank" } ]
Patterns are tested against the transaction description. If you need to update them later, edit the file above and run
./scripts/put-patterns.sh
. -
Install the dependencies:
npm i
-
Run the bootstrap script to create all the resources and deploy:
npm run bootstrap
By default, every 90 days the end user agreement must be renewed.
7 days before end user agreement expires, bankman sends a notification to Discord which looks like this:
End user agreement expires in 7 days.
Until renewal, a similar notification is sent every day.
Bankman comes with a few simple scripts to ease the renewal process. Make sure you've followed the instructions in Pre-requisites and Getting Started.
-
Pick the institution ID you want to use for the agreement, you can list them with (use your country code):
./scripts/nordigen-list-institutions.sh <country-code>
-
Create a new user agreement with the institution ID:
./scripts/nordigen-create-agreement.sh <institution-id>
-
Use the
id
field in the result of the script above as the<agreement-id>
that follows:REFERENCE=$(date +%Y%m%d) ./scripts/nordigen-link-agreement.sh <agreement-id>
The REFERENCE
can be any value as long as it is different from the one used last time you linked an agreement.
If by any chance you're missing the <agreement-id>
, you can list your account's agreements with:
./scripts/nordigen-list-agreements.sh
- Click the link returned in the response object under the field
link
and follow the instructions to approve the new agreement for your bank account.
If by any chance you lose the response object with the link, you can list your account's requisitions with:
./scripts/nordigen-list-requisitions.sh