@autional/api-billing
v0.2.1
Published
AuthMS Billing Service API — auto-generated TypeScript client
Readme
@authms/api-billing
AuthMS Billing Service API — auto-generated TypeScript client for billing-service (9 functions).
Functions
| Function | Description |
|----------|-------------|
| getPlans(client) | Get available billing plans (public endpoint) |
| getSubscription(client) | Get current tenant subscription |
| subscribe(client, data) | Subscribe to a billing plan |
| cancelSubscription(client) | Cancel current subscription |
| getUsage(client) | Get current usage metrics |
| getInvoices(client) | Get invoices list |
| getInvoice(client, id) | Get a specific invoice by ID |
| getBalance(client) | Get account balance |
| getFeatureGates(client) | Get feature gates for current tenant |
Install
npm install @authms/core @authms/api-billingQuick Start
import { AuthMS, browserPlatform } from '@authms/core';
import { getPlans, getSubscription, subscribe } from '@authms/api-billing';
const authms = new AuthMS({ appId: 'my-app', issuer: 'https://auth.iam.tianv.com', platform: browserPlatform });
await authms.initialize();
const plans = await getPlans(authms.api);
const sub = await getSubscription(authms.api);
await subscribe(authms.api, { planId: plans[0].id });See the root SDK README for full documentation.
