Skip to content

@core-labs/billing-kit

Purpose

Centralises plan definitions and exposes usageStatus, getPlan, and the PaymentAdapter interface.

Public API

import { getPlan, usageStatus } from "@core-labs/billing-kit";
const plan = getPlan("pro");
const status = usageStatus(plan, usedRequests);
// → { percent: 72, exceeded: false }

PaymentAdapter interface

interface PaymentAdapter {
createCheckoutSession(input: CheckoutInput): Promise<CheckoutSession>;
handleWebhook(payload: string, signature: string): Promise<BillingEvent>;
}

Concrete adapters live in core-platform/src/adapters/payments/.