Skip to main content
Web Chat is in closed beta. Contact us at [email protected] to get access.
The useWebChat hook is the headless client for Web Chat. It loads conversation history, sends messages, streams live turns over the socket, and exposes pending tool approvals. Use it inside NovuProvider. See Quickstart, Chat UI, and State.

Hook parameters

Pass agentId (and optional conversationId and agentHash), or pass conversation. Do not mix the two.

Return value

Pagination

pagination is the older-history control. It is not a top-level hasMore or fetchMore. See Older messages.

Recovery

The hook reconnects and catches up on its own. Use these fields for a banner. See Reconnect.

Message type

Part types

Pending actions

pendingActions is derived from pending approval and mcp-connection parts.

Plan limit error

WebChatPlanLimitError is set on the hook error field when the organization is over a plan limit. The HTTP status is 402.

JavaScript SDK

The same runtime lives on novu.webChat.conversation() in @novu/js. Call loadWebChat(novu) first in JavaScript. The React hook loads Web Chat for you. Do not call novu.webChat.subscribe() from React UI code.