npm Package Install @aomi-labs/react for headless runtime logic and state management.
The npm package provides headless logic — runtime providers, state management, API clients, and utilities. No UI components are included; those come from the shadcn registry .
npm install @aomi-labs/react
Export Description AomiRuntimeProviderConnects to Aomi backend, manages chat sessions ThreadContextProviderThread state management (current thread, messages) RuntimeActionsProviderActions for thread operations
Hook Description useThreadContextAccess current thread ID, view key, and actions useCurrentThreadMetadataGet current thread's title, status, timestamps useCurrentThreadMessagesAccess messages in current thread useRuntimeActionsThread operations (create, delete, switch)
Export Description BackendApiDirect API client for Aomi backend
import type {
SessionMessage ,
ThreadMetadata ,
ThreadStatus ,
WalletButtonState ,
WalletFooterProps ,
} from "@aomi-labs/react" ;
Export Description cnClass name merger (clsx + tailwind-merge) WalletSystemMessageEmitterEmits wallet state changes as system messages formatAddressTruncates wallet addresses for display getNetworkNameResolves chain ID to network name
import {
AomiRuntimeProvider ,
ThreadContextProvider ,
useThreadContext ,
} from "@aomi-labs/react" ;
function App () {
return (
< ThreadContextProvider >
< AomiRuntimeProvider
backendUrl = "https://api.aomi.dev"
publicKey = { walletAddress }
>
< YourChatUI />
</ AomiRuntimeProvider >
</ ThreadContextProvider >
) ;
}
function YourChatUI () {
const { currentThreadId } = useThreadContext () ;
// Build your own UI using the state...
}
The package requires these peer dependencies:
{
" @assistant-ui/react " : "^0.11.0" ,
" react " : "^18.0.0 || ^19.0.0" ,
" react-dom " : "^18.0.0 || ^19.0.0"
}