CKB KeyWay
Email-native CKB accounts and Fiber payments for React applications.
CKB KeyWay gives a React application email OTP login, a recoverable CKB testnet account with a CCC signer, and the user's own Fiber node, hosted by KeyWay or run in the browser. Login does not start Fiber.
npm install @ckb-keyway/react"use client";
import {
KeyWayLoginButton,
KeyWayProvider,
useKeyWay,
useCkbWallet,
} from "@ckb-keyway/react";
export function Providers({ children }: { children: React.ReactNode }) {
return <KeyWayProvider appId="keyway_..." appName="Your app">{children}</KeyWayProvider>;
}
export function WalletStatus() {
const { ready, authenticated } = useKeyWay();
const { status, address } = useCkbWallet();
if (!ready) return <p>Loading...</p>;
return (
<div>
<KeyWayLoginButton />
{authenticated && status === "loading" ? <p>Loading wallet...</p> : null}
{address ? <p>{address}</p> : null}
</div>
);
}Quickstart
Install the SDK and recover your first wallet.
Fiber payments
Open a channel, create invoices, and send payments.
Fiber node
Every Fiber method under its own name, and what the user approves.
React SDK
Provider, hook, components, and client methods.
Live demo
Test the complete flow on CKB testnet.
This is a testnet preview. Create a public app ID and register browser origins in the developer console before integrating.
What the SDK handles
- Email OTP UI and session recovery
- Stable CKB account recovery through Lit
- A CCC signer for CKB, token, NFT and Nervos DAO transactions, with an approval dialog
- A hosted or browser Fiber node for each user, with Fiber's full method set
- Fiber channels funded from the user's account, in CKB or tokens such as RUSD
- Fiber invoices, routed payments, keysend and hold invoices
- Optional emailed confirmation codes past a daily amount per asset
Requirements
- React 18.2 or newer
- A modern browser with Web Locks and Web Crypto
- Browser mode additionally requires WebAssembly, IndexedDB, and cross-origin isolation
- CKB testnet funds when opening a channel
View on npm
Package metadata, dependencies, and published versions.