Skip to content

Function: useMastraChat()

useMastraChat<TValues>(options?): Omit<ChatViewProps, "className">

Headless driver for the Mastra chat experience. Owns the full conversation lifecycle (streaming, tool-event tracking, approvals, model selection, clear, and infinite-scroll-up history) over @mastra/client-js and returns the exact prop bag ChatView consumes. Use this when you want the drop-in behaviour but need to render the view yourself; otherwise reach for MastraChat.

TValues extends Record<string, unknown> = Record<string, unknown>

UseMastraChatOptions<TValues> = {}

Omit<ChatViewProps, "className">