SDK Overview
@amodalai/react connects a web application to a deployed Amodal runtime over HTTP and server-sent events.
| Need | Use |
|---|---|
| Add chat to a React app | ChatWidget, available from @amodalai/react/widget. |
| Build a UI with agent actions, sessions, and events | AmodalProvider and hooks. |
| Render inline chat inside a provider | AmodalChat. |
| Call runtime APIs from imperative code | RuntimeClient, SdkClient, or ChatClient. |
Install
npm install @amodalai/reactThe package requires React and React DOM 18 or 19. Import @amodalai/react/style.css when using the chat components.
Authentication
For an app served at the agent's own origin, use window.location.origin as the runtime URL and omit getToken. See Hosted browser login.
For a multi-tenant product, point the SDK at an application proxy that keeps runtime credentials and authorizes each scope, session, and operation. Pass getToken separately to AmodalProvider and AmodalChat. See Embedding.