npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

flanks

v0.1.1

Published

A Node.js client for the Flanks API

Readme

flanks-node npm version

Node.js client for Flanks API.

Install

$ npm install flanks

Getting started

This module enables Node.js developers to easily access all Flanks API endpoints.

First, include the flanks module in your desired .js files:

const flanks = require('flanks');

Then, you can start using the supported endpoints. This module is using endpoints from a stateful sandbox environment.
You can find the complete API Documentation here.

Token overview

Most API requests interact with a credentials_token or a set of credentials (map of key-value pairs) associated with a financial institution. A single end-user of your application might have accounts at different financial institutions.
Credit and depository accounts may also have transactions associated with them.

That credentials_token or credentials uniquely identify the account. You can use the access_token along with your OAuth Token to access products available for an account and make changes to it over time.

Important: remember to pass your OAUTH_TOKEN as an environment variable when calling your script.

$ OAUTH_TOKEN=<YOUR_OAUTH_TOKEN> node script.js

Accessing data

Once you create a credentials_token, you can then access data—such as transaction data, account information and routing numbers—using our API endpoints. You access data using the credentials_token, which is specific to your API keys and cannot be shared or used by any other API keys. By default, a credentials_token never expires, but it can rotate.

Creating credentials

Now that you have API keys and know the basics of the Flanks API, it is time to integrate with flank's clients, which will handle credential validation, multi-factor authentication, and error handling for each institution that we support.

Clients allow interaction with the Flanks system in an easier and faster way. We currently have different clients that are integrated with the main important market languages. In our clients, previous validations are incorporated to save calls to the system and speed up the interaction with it.

Credentials can be created as follows:

flanks.createCredentials({
    username: 'username',
    password: 'password',
    bank: 'bank',
})
.then(response => {
    console.log(response.data);
})
.catch(err => {
    console.error(err);
});

The following is a successful response:

{
  "credentials_token": "<YOUR_CREDENTIALS_TOKEN>",
  "message": "Credentials created successfully"
}

Deleting credentials

Similarly, to delete existing credentials, simply use its associated credentials_token:

flanks.deleteCredentials('<YOUR_CREDENTIALS_TOKEN>')
.then(response => {
    console.log(response);
})
.catch(err => {
    console.error(err);
});


// async version
async function foo() {
    try {
        const response = await flanks.deleteCredentials('<YOUR_CREDENTIALS_TOKEN>');
        console.log(response.data);
    } catch (err) {
        console.error(err);
    }
}

Pulling financial data

Once you have a credentials_token, you can use it to access financial information without need to input passwords periodically:

flanks.getAccountData('<YOUR_CREDENTIALS_TOKEN>')
.then(response => {
    console.log(response.data);
})
.catch(err => {
    console.error(err);
});

A successful response has the following schema:

{
  "account": {
    "alias": "string",
    "amount": {
      "value": null,
      "currency": "string"
    },
    "availability": "string",
    "bank": "string",
    "description": "string",
    "iban": "string",
    "isOwner": true,
    "numOwners": null,
    "owner": "string"
  },
  "amount": null,
  "balance": null,
  "bank": "string",
  "cardNumber": "string",
  "category": "string",
  "currency": "string",
  "dateOperation": "yyyy-mm-dd",
  "dateValue": "yyyy-mm-dd",
  "description": "string",
  "expense": true,
  "id": "string",
  "productDescription": "string",
  "service": "string",
  "transfer": {
    "beneficiary": "string",
    "ibanBeneficiary": "string",
    "ibanOrdenant": "string",
    "ordenant": "string"
  }
}

Pulling personal data

Flanks allows you to retrieve all personal information from a bank account:

flanks.getAuth('<YOUR_CREDENTIALS_TOKEN>')
.then(response => {
  console.log(response.data);
})
.catch(err => {
  console.error(err);
});

Pulling card information

You can get information about the cards associated to your bank account.

flanks.getCards('<YOUR_CREDENTIALS_TOKEN>')
.then(response => {
  console.log(response.data);
})
.catch(err => {
  console.error(err);
});

Pulling card transactions

You can also pull the transactions associated with your cards.

flanks.getCardTransactions('<YOUR_CREDENTIALS_TOKEN>')
.then(response => {
  console.log(response.data);
})
.catch(err => {
  console.error(err);
});

Uploading files

Flanks provides several endpoints to help business banking users with file handling and management.
You can upload a file to your business banking account.

flanks.uploadFile('<YOUR_CREDENTIALS_TOKEN>', '<PATH_TO_FILE>', '<FILE_TYPE>')
.then(response => {
  console.log(response.data);
})
.catch(err => {
  console.error(err);
});

Check the API docs linked above to find out about the supported file types and extensions.

Using ES2017 async/await

You can also use the new async/await keywords introduced in ECMAScript 2017. For example, inside an async function, you could pull data like this:

async function foo() {
  try {
    const response = await flanks.getAccountData('<YOUR_CREDENTIALS_TOKEN>');
    console.log(response.data);  
  } catch (err) {
    console.error(err);
  }
}