@amodalai/react
React components, hooks, and clients for a deployed Amodal agent.
Install
npm install @amodalai/react
Requires React and React DOM 18 or 19.
Usage
import { ChatWidget } from '@amodalai/react/widget';
import '@amodalai/react/widget/style.css';
export function AgentChat({ getAppToken }: { getAppToken: () => Promise<string> }) {
return <ChatWidget serverUrl="https://app.example.com/api/agent" getToken={getAppToken} position="floating" />;
}
getAppToken supplies your application token to your proxy, which must authenticate each request and authorize its
scope, session, and operation. Keep runtime credentials on the backend.
Main exports
ChatWidgetrenders chat infloating,inline,right, orbottomlayout.AmodalProviderconfigures clients for data, action, session, and event hooks.AmodalChatrenders inline chat inside it.ArtifactHostshares files betweenChatWidgetand your own panels.RuntimeClient,SdkClient, andChatClientprovide imperative access.
See the React reference, chat reference, and embedding guide.