@xflowpay/xflow-node-sdk v0.0.7
Xflow Node API Library
This library provides convenient access to the Xflow Node REST API from server-side TypeScript or JavaScript.
The API documentation can be found here.
Installation
npm install --save @xflowpay/xflow-node-sdk
# or
yarn add @xflowpay/xflow-node-sdk
Usage
import { XFlow } from '@xflowpay/xflow-node-sdk';
const xFlow = new XFlow({
bearerAuth: 'my bearer auth',
});
async function main() {
// List Accounts:
const accountList = await xFlow.accounts.listAccounts();
console.log(accountList);
// Retrieve Account:
const account = await xFlow.accounts.retrieveAccount('<account id>');
console.log(account);
}
main();
Request & Response types
This library includes TypeScript definitions for all request params and response fields. You may import and use them like so:
import { XFlow, ListAccountsResponse } from 'xflow';
const xFlow = new XFlow({
bearerAuth: 'my bearer auth',
});
async function main() {
const account: ListAccountsResponse = await xFlow.accounts.listAccounts();
}
main();
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
Semantic Versioning
This package generally attempts to follow SemVer conventions, though certain backwards-incompatible changes may be released as minor versions:
- Changes that only affect static types, without breaking runtime behavior.
- Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals).
- Changes that we do not expect to impact the vast majority of users in practice.
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
We are keen for your feedback; please open an issue with questions, bugs, or suggestions.
Requirements
The following runtimes are supported:
- Node.js 16 LTS or later (non-EOL) versions.
If you are interested in other runtime environments, please open or upvote an issue on GitHub.