KeyWayProvider

Wrap the part of the React tree that uses KeyWay.
string
Public application ID from the KeyWay developer console. SDK requests are accepted only from origins registered to this application.
string
default:"CKB KeyWay"
Name displayed in the embedded login UI. Limited to 64 characters.
"light" | "dark"
default:"light"
Appearance of KeyWay’s login and funding confirmation modals.
boolean
default:"true"
Recover the wallet and start Fiber automatically after authentication.
"browser" | "managed"
default:"managed"
Select the Fiber runtime. From SDK 0.0.7, managed mode uses KeyWay’s persistent native testnet node by default, subject to host capacity limits. Browser mode runs WASM locally. Switching modes does not migrate channels.
ConfirmFunding
Optional callback for approving the validated on-chain channel funding transaction. Return true to continue to Lit-authorized signing or false to abort. When omitted, KeyWay renders its styled built-in confirmation modal.
(error: Error) => void
Receives connection and device-lease failures.
(event: KeyWayLifecycleEvent) => void
Receives structured wallet recovery, lease, database restore, WASM startup, peer connection, synchronization, and ready events with elapsed milliseconds.

useKeyWay()

connection

Use connection.wallet.ckbAddress for the recovered address and connection.keyway for Fiber operations. Both connection modes implement the recommended methods below. Inspect connection.mode when an application needs runtime-specific UI. Browser mode requires cross-origin isolation and explicit-logout database handoff. Managed mode stays online outside the page lifecycle and does not migrate existing browser channels. The managed host holds operational node keys and state; it is a different trust model from a local browser node.

Buttons

KeyWayLoginButton toggles login/logout. KeyWayConnectButton starts or stops Fiber and opens login first when needed. Both accept normal button attributes and label overrides.