Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lekesoldat/sbanken-node

🏦 A package for communicating with the S´banken API.
https://github.com/lekesoldat/sbanken-node

banking nodejs sbanken-api

Last synced: about 5 hours ago
JSON representation

🏦 A package for communicating with the S´banken API.

Awesome Lists containing this project

README

        

# 🏦 S'banken-node

A package for communicating with the S´banken API.

## Setup

Make sure to create a `.env` file at the root of the cloned repository. It should have the following fields:


USER_ID=
CLIENT_ID=
SECRET=

## Running the project

```zsh
$ yarn install # Install dependencies
$ yarn start # Run index.mjs
```

## Usage

Code found in `index.mjs` aswell.

```javascript
// Import as early as possible.
import dotenv from 'dotenv';
dotenv.config();

// Import desired functions
import {
getAccountDetails,
getAccountNumberDetails,
getAccountTransactions
} from './Api.mjs';

const main = async () => {
try {
const details = await getAccountDetails();
console.log('Retrieved details:\n', details);

const numberDetails = await getAccountNumberDetails('YourAccountId');
console.log('Retrieved number details:\n', numberDetails);

const transactions = await getAccountTransactions('YourAccountId');
console.log('Retrieved transactions:\n', transactions);
} catch (error) {
console.log(error);
}
};

main();
```