Skip to content

formancehq/numary-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Formance Typescript SDK

This repository contains the Typescript SDK for Formance Ledger (fka Numary) for Node.js, wrapping the automatic generated API client with higher-level functionality.

Installation

yarn add numary

Usage

import Cluster from "numary";

const cluster = new Cluster({
  uri: 'http://localhost:3068',
});

const ledger = cluster.getLedger('some-ledger');

(async () => {
  const r = await ledger.getTransactions();

  for (const tx of r.data) {
    console.log(tx);
  }
})();

Using Formance Cloud

Moved to @formancehq/formance

Advanced options

Axios interceptors can be used on the underlying cluster connection, e.g. to add authentication headers:

const cluster = new Cluster({
  uri: 'http://example.com:3068',
});

cluster.conn.interceptors.request.use(config => {
  config.headers['Authorization'] = `Basic Zm9vOmJhcg==`;

  return config;
});

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published