This SDK exposes JS functions for all endpoints in the docs here(you may need to login to access the docs)
It currently only supports the Berlin
flavour of the API standards.
Using NPM
- SSH
npm install git+ssh://[email protected]/hafbau/sdk_atb_leapos.git
- HTTPS
npm install git+https://[email protected]/hafbau/sdk_atb_leapos.git
const sdk = require('sdk_atb_leapos');
const { token } = await sdk.login({
username: '<username> e.g. yobanky',
password: '<password> e.g. twopackstoobig',
consumer_key: '<your consumer key>'
});
const accounts = await sdk.getBankAccountsBalances({
params: { BANK_ID: 'theBankId' }
});
login
Takes a credential object (optional if you have the right env variables defined). Returns an object with token
.
- With environment variables defined:
require('dotenv').config()
const sdk = require('sdk_atb_leapos');
// default login credentials will be loaded from process.env
const { token } = await sdk.login();
Your .env
file should include these keys with appropriate values:
OPB_USERNAME=
OPB_PASSWORD=
OPB_CONSUMER_KEY=
remaining methods
- All methods take an object as input. The keys in the object are
params
,body
,query
andtoken
. token
is a string, the other three are all objects.- depending on the method being called, all four keys are optional.
See methodsList.json for methods mapping to endpoints. Then go to the API docs to learn more.
- Write tests, please!
- Issues and PRs encouraged.
MIT