Skip to main content
All hooks exported by @aomi-labs/react. Every hook must be used inside AomiRuntimeProvider.

useAomiRuntime

The unified hook that combines all runtime APIs into a single interface. This is the primary way to interact with the Aomi runtime.

Return Type

useUser

Wallet and user state management. UserState is a nested object: EVM identity lives under evm, Solana under svm, and session-level connection facts under connection. Read fields with the UserState accessor functions rather than reaching into the object directly. useUser returns { user, setUser, addExtValue, removeExtValue, getUserState, onUserStateChange }.

UserState

UserState is canonicalized to the backend’s nested snake_case shape. The fields you read most often:
Accessor functions normalize the nested shape for you: UserState.address, UserState.chainId, UserState.ensName, UserState.isConnected, UserState.svmAddress, and UserState.preferredPublicKey.

useThreadContext

Low-level thread state management. Use useAomiRuntime for most cases.

Convenience Hooks

useControl

Model, app, and API key state management.

ControlState

useNotification

Toast notification management.

Notification Type

useEventContext

SSE subscription and outbound event dispatch.

useWalletHandler

Handles wallet transaction requests and EIP-712 signing requests from the AI backend. useWalletHandler takes a { getSession } config that returns the ClientSession for the current thread, and returns { pendingRequests, setRequests, startRequest, resolveRequest, rejectRequest }. Each request’s kind is "transaction", "eip712_sign", or "solana_sign". When you resolve a request, the result.kind must match the request’s kind.

Next Steps

Last modified on June 4, 2026