Skip to main content

React & Angular API

The hooks, props, services, and inputs exposed by the UI SDKs. For a walkthrough of setting these up, see Using Distri in your product.

Hooks

HookDescription
useAgent()Load an agent by id or definition.
useChat()Full chat state: messages, streaming, and tools.
useChatMessages()Access the message history.
useDistri()The DistriClient, loading state, and errors.
useThreads()List and manage conversation threads.
useWorkspace()Get and set the active workspace.
useWorkflow()Drive a workflow and read step progress.

<Chat> props

PropTypeDescription
agentAgentFrom useAgent().
threadIdstringConversation to attach to.
externalToolsDistriAnyTool[]Your product's tools.
enableHistorybooleanLoad prior messages for the thread.
getMetadata() => Promise<object>Inject dynamic context each message.
onChatInstanceReady(instance) => voidGet a handle to the chat instance.