Superbilling API를 쉽게 사용할 수 있는 TypeScript/JavaScript SDK입니다.
npm install superbilling
# 또는
yarn add superbilling
# 또는
pnpm add superbilling
import { SuperBillingClient } from 'superbilling';
// 인증 정보와 함께 인스턴스 생성
// 각 key는 optional 합니다.
const superbilling = new SuperBillingClient({
clientKey: 'your-client-key',
secretAccessKey: 'your-secret-access-key'
});
// API 호출
const portalSession = await superbilling.portal_session.create({
customerId: 'customer-id',
returnUrl: 'https://your-return-url.com'
});
// 고객 정보 조회
const customer = await superbilling.customer.get('customer-id');
// 포털 세션 생성
const session = await superbilling.portal_session.create({
customerId: 'customer-id',
returnUrl: 'https://your-return-url.com'
});
// 요금제 목록 조회
const plans = await superbilling.plan.list();
SDK는 TypeScript로 작성되어 있어 모든 API 요청 및 응답에 대한 타입 정의를 제공합니다.
import type { Customer, Plan, PortalSession } from 'superbilling';