FiberMeter is usage-based billing and prepaid service-metering infrastructure for Fiber Network.
FiberMeter lets developers and service providers meter usage and collect payments on Fiber Network without rebuilding billing primitives for every product. It combines prepaid balances, pricing rules, usage metering, payment requests, append-only ledger entries, and signed webhooks so teams can build paid APIs, AI tools, webhook products, and other pay-as-you-go services.
Conceptually, FiberMeter provides Stripe Billing-style usage metering and prepaid credits with Fiber-native settlement. It is infrastructure for merchants, service developers, wallet teams, and node or LSP operators rather than a consumer wallet.
usage.charged webhook notifies the service’s backend.The standalone AI Summary application demonstrates this flow at https://demo.fibermeter.toneflix.net.
SimulatedFiberPaymentProvider is the default local-development provider. It
creates fiber-sim:// payment requests and exposes Simulate Paid, allowing
developers to exercise funding, metering, ledger, and webhook behavior without
a Fiber node, faucet funds, or a payment channel.
LiveFiberPaymentProvider creates real fibt1… invoices through a merchant
Fiber node and verifies settlement using get_invoice. The customer pays from
a separate Fiber node or wallet. FiberMeter credits the prepaid balance only
after the payee node confirms that the invoice is paid.
The optional hosted topology runs a payee node and a separate, bounded testnet payer. The payer automates customer-side settlement for product testing while the dashboard exposes the channel’s on-chain CKB funding transaction. See the hosted live deployment runbook.
usage.charged webhook delivery and manual retry.FiberMeter is a pnpm workspace containing:
@fibermeter/sdk server-side JavaScript SDK.FiberPaymentProvider.Both payment providers converge on the same payment-request, balance, ledger, usage-metering, and webhook services. Switching payment providers changes the settlement boundary without replacing the billing engine.
Start PostgreSQL, the API, dashboard, and demo service with:
docker compose up
Or use the pnpm workflow:
pnpm bootstrap
pnpm dev
The dashboard is available at http://localhost:5173, the standalone demo at
http://localhost:5174, and the API at http://localhost:4000.
The standard workspace command starts the demo’s Vite interface only. Run the demo through Netlify Dev when testing its server-side metering and webhook functions; see the demo service README.
See the quickstart for database setup and the demo walkthrough for a guided product flow.
The simulated provider is intended for development and integration testing. The live provider has completed real Fiber testnet settlement, but production operation still requires additional controls such as scoped credentials, rate limiting, automated reconciliation, managed secrets, durable background jobs, and a hosted-node or LSP adapter.
The maintained implementation plan is in ROADMAP.md.