Skip to content

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

License

Notifications You must be signed in to change notification settings

Lekesoldat/sbanken-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏦 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

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

Usage

Code found in index.mjs aswell.

// 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();

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published