https://github.com/killbill/killbill-client-js
JavaScript client library for Kill Bill
https://github.com/killbill/killbill-client-js
Last synced: about 1 year ago
JSON representation
JavaScript client library for Kill Bill
- Host: GitHub
- URL: https://github.com/killbill/killbill-client-js
- Owner: killbill
- Created: 2012-06-17T22:31:57.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2024-04-08T18:14:42.000Z (about 2 years ago)
- Last Synced: 2025-03-26T08:12:19.169Z (about 1 year ago)
- Language: TypeScript
- Homepage: http://killbill.io/
- Size: 515 KB
- Stars: 30
- Watchers: 12
- Forks: 17
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE-2.0.txt
Awesome Lists containing this project
README
killbill-client-js
==================
JavaScript client library for Kill Bill.
It is designed to run both on the client side as well as on the server side (e.g. using node.js).
Codegen
-
Code is generated using [openapi-codegen](https://github.com/OpenAPITools/openapi-generator) typescript-axios template.
To regenerate, overwrite kbswagger.yaml and `npm run codegen && npm run build`
Usage
-
``` javascript
const killbill = require('killbill');
const globalAxios = require('axios');
const axios = globalAxios.create();
//optional - follow location header when new object is created
axios.interceptors.response.use(killbill.followLocationHeaderInterceptor);
//optional - configure tough cookie support
const tough = require('tough-cookie');
const axiosCookieJarSupport = require('axios-cookiejar-support').default;
axiosCookieJarSupport(axios);
axios.defaults.withCredentials = true;
axios.defaults.jar = new tough.CookieJar();
const config = new killbill.Configuration({
username: "admin"
password: "password",
apiKey: killbill.apiKey("bob", "lazar"),
basePath: "http://127.0.0.1:8080"
});
new killbill.AccountApi(config, null, axios).getAccountByKey("external_key")
.then(result => console.log(result))
.catch(error => console.log(error));
```