This module simplifies communicating with CodeX Accounting API.
-
Import module to project
import Accounting from 'codex-accounting-sdk';
-
Create accounting object with accounting URL in parameter
const accounting = new Accounting({ baseURL: '127.0.0.1:25565', });
-
Use Accounting SDK in your project
accounting.createAccount({ name: 'Workspace', type: AccountType.LIABILITY, currency: Currency.USD, });
Create accounting object with settings like this:
const accounting = new Accounting({
baseURL: '127.0.0.1:25565',
tlsVerify: {
tlsCaCertPath: '/usr/src/app/src/accounting/tls/ca.pem',
tlsCertPath: '/usr/src/app/src/accounting/tls/client.pem',
tlsKeyPath: '/usr/src/app/src/accounting/tls/client-key.pem',
},
});
You need to assign path values to tlsCaCertPath
, tlsCertPath
and tlsKeyPath
in tlsVerify
object.
To build the library, run the following command:
yarn build