@pliancy/chargebee-sdk
v0.1.0
Published
SDK wrapper for the Chargebee TypeScript library
Downloads
1
Readme
SDK wrapper for the Chargebee TypeScript SDK
Why
The chargebee-typescript library is a bit
unwieldy and exports its types from various places within the codebase. This wrapper exports its
types from the root of the project and converts Chargebee methods that return a request
to
simple promises.
Currently Supported
- Customers
getCustomerById
- Subscriptions
getSubscriptions
getSubscriptionsByCustomerId
updateSubscription
- Invoices:
getInvoiceById
Install
# Yarn
yarn add @pliancy/chargebee-sdk
# npm
npm install @pliancy/chargebee-sdk
Usage
// environment defaults to dev. Pass 'prod' as the second argument for producton
import { Invoice } from '@pliancy/chargebee-sdk'
const chargebee = new ChargeBee({ site: 'mySite', api_key: 'myApiKey' })
const invoice: Invoice = await chargebee.getInvoiceById(1)
Test
yarn test
# or
yarn test.watch
Test Coverage
yarn test.cov
# then
yarn cov.view