SDK and CLI toolchain for Fiber Network
Integrate Fiber payments with one React component.
Start Fiber node with one CLI command.
fiber-pay is an AI-friendly toolchain for CKB Lightning on Fiber Network. Build production payment flows with a React-first SDK layer and run AI-agent-native command workflows with a CLI designed for automation.
Get started with the React SDK · Try the CLI workflows · Browse examples
- React plug-and-play.
FiberPayQuickCardandFiberNodeButtonfor rapid payment UI integration. - CLI Node and channel operations. Start, inspect, and manage Fiber node state with the CLI.
- L402 paywall in one command. Use
fiber-pay l402 proxyto turn an HTTP endpoint into a paid, token-gated experience.
React-First SDK
Most teams integrate through @fiber-pay/react first, then drop down to
lower-level SDK APIs only for advanced control. Start with component primitives,
keep the browser-node lifecycle in hooks, and customize the panel UX as needed.
- Quick entry:
FiberPayQuickCardfor invoice + payment flows. - Full panel:
FiberNodeButtonwith tabs customization and i18n override. - Hooks:
useFiberNodeanduseFiberPaymentfor controlled app state.
import { FiberPayQuickCard, FiberNodeButton, useFiberNode } from '@fiber-pay/react';
export function WalletPanel() {
const fiber = useFiberNode({ network: 'testnet', walletId: 'demo-wallet' });
return (
<>
<FiberNodeButton
fiber={fiber}
strategy="passkey"
tabs={[{ id: 'workbench' }, { id: 'channels' }]}
t={(key, fallback) => key === 'tabs.workbench' ? 'Workbench' : fallback}
/>
<FiberPayQuickCard fiber={fiber} network="testnet" />
</>
);
}
Advanced: low-level SDK API (FiberRpcClient)
import { FiberRpcClient } from '@fiber-pay/sdk';
const client = new FiberRpcClient({
url: 'http://127.0.0.1:8227',
biscuitToken: process.env.FIBER_RPC_BISCUIT_TOKEN,
});
const info = await client.nodeInfo();
console.log(info.pubkey);
CLI for Fiber operations and L402 paywalls
The CLI is most useful for everyday Fiber operations: launch a local node, inspect
network state, open or list channels, and put a simple paywall in front of any HTTP API
with l402 proxy.
- One-command node startup and status checks with
node startandnode info. - Channel lifecycle helpers with
channel openandchannel list. l402 proxyfor monetizing existing HTTP APIs with a lightweight paywall.
npm install -g @fiber-pay/cli
# 1) start local Fiber node
fiber-pay --profile demo node start --json
# 2) open a channel
fiber-pay --profile demo channel open --peer <pubkeyOrMultiaddr> --funding 1000 --json
# 3) inspect channel state
fiber-pay --profile demo channel list --json
# 4) monetize any HTTP API with L402
fiber-pay l402 proxy --target http://localhost:3000 --price 0.1 --root-key <hex>
For more experimental agent-native flows, agent serve and agent call are still available, but they are best treated as advanced use cases rather than the main entry point.
The CLI is also built for automation and agent-style workflows:
logsandruntimefor debugging, streaming, and health checks.job list,job get, andjob tracefor following background work and retries.binaryandconfigto manage local Fiber binaries and multiple-profile settings.
# inspect recent runtime activity
fiber-pay logs --tail 100
# start the runtime monitor and inspect status
fiber-pay runtime start
fiber-pay runtime status
# inspect jobs emitted by automation or agent workflows
fiber-pay job list --json
# manage the local Fiber binary and profile config
fiber-pay binary info
fiber-pay config list
Start building on fiber-pay today
Choose your path: automate operations with CLI, implement core logic with SDK, or ship UI fast with React on top.