Skip to content

Repzo/chargebee-typescript

 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 93.9%
  • JavaScript 5.4%
  • Shell 0.7%