@theoo/react
v0.4.2
Published
React hooks and components for Theoo: sign-in, passkeys, operations, recovery and session keys.
Readme
@theoo/react
React bindings for Theoo — smart accounts owned by a passkey.
npm install @theoo/react @theoo/sdkimport { TheooProvider, useSession, useOperation } from "@theoo/react";
<TheooProvider client={theoo}>
<App />
</TheooProvider>;
function App() {
const session = useSession();
const op = useOperation();
if (session.status !== "signed_in") return <SignIn />;
return (
<button onClick={() => op.run({ kind: "call", call })}>
{op.busy ? "Waiting for your passkey…" : "Send"}
</button>
);
}Hooks — useSession, useSignIn, useEnrolPasskey, useChains,
useOperation, useOperations, useRecovery, useSessionKeys,
useSolanaSessionKeys.
Components — SignIn, PasskeyEnrol, ConfirmOperation, Recovery, and
TheooConnect, the connect-wallet button.
@theoo/react/hooks is the DOM-free half, which
@theoo/react-native
builds on.
