AomiWidget, then take ownership of more of the interface only when your product needs it.
Choose your customization level
Configure AomiWidget
Use presentation props to fit the widget into a page, panel, or modal.
These props change presentation. The Application ID selects the deployed App; action review and wallet execution remain visible client responsibilities.
Apply themes and styles
Import the default stylesheet once:Compose with AomiFrame
Use the compound API when the standard widget layout is close to what you need, but you want to rearrange its sections.AomiFrame provides the chat surface and runtime. If you use it outside AomiWidget, your application must supply the surrounding authentication and account integration.
Own the source with shadcn
Copy the widget components into your repository when you need to change markup or component behavior:Build a headless UI
Choose the headless library when props, themes, composition, and copied components are not enough. Aomi continues to provide thread, chat, user, event, notification, and wallet-request state. You provide every visible interaction.Install the library
Add the runtime provider
Your responsibilities
A headless interface must provide:- Thread navigation and message rendering.
- Composer, streaming, cancellation, and error states.
- Wallet connection and network selection.
- Transaction-call and fee disclosure.
- Explicit approval and rejection controls.
- Owner and network validation before signing.
- Submitted, confirmed, expired, and failed operation states.
Hooks
All hooks must run beneathAomiRuntimeProvider.
Chat and threads
Read active-thread messages with
useAomiRuntime().getMessages().
User and wallet controls
Events and notifications
Read ordered backend events from
useAomiRuntime().events and the active lifecycle from turnState. pendingActions contains canonical Actions; narrow on action.request.kind before reading its payload. Use the exported TypeScript types as the source of truth for complete signatures and payloads.