Skip to main content

Web Chat is how you embed an agent inside your own app. It is an Agent Communication Infrastructure (ACI) channel, the same layer Slack and Teams use, except you own the surface: message list, composer, and layout.

The React client is useWebChat from @novu/react. There is no prebuilt <WebChat /> component. If you are not on React, use conversation() from @novu/js.

Setup#

Create an agent and keep it active. Then add the channel in the dashboard:

  1. Open the agent in the Novu dashboard.
  2. Add Web Chat. Novu creates the novu-web-chat integration if it is missing.

Install#

Collect these values from the dashboard, then install @novu/react:

  • Application identifier from API Keys
  • A subscriber id for the signed-in person
  • The public agent identifier from the agent page
Note

@novu/react requires React 18 or later (^18.0.0 or ^19.0.0).

Place NovuProvider above the chat. useWebChat gets the Novu client from that context.

NovuProvider signs the subscriber in. useWebChat selects which agent to talk to.

Note

Replace YOUR_* placeholders with values from API Keys and Subscribers.

Add Novu Web Chat to my React appOpen in Cursor

Add Novu Web Chat to a React app#

Install @novu/react. Wrap the app in NovuProvider. Call useWebChat and render your own message list and composer. There is no prebuilt <WebChat /> component.

Canonical example: https://docs.novu.co/agents/channels/web-chat

ALWAYS:

  • Detect the project’s package manager and use it for installation
  • Use NovuProvider from @novu/react (not a second Novu client)
  • Pass the dashboard agent identifier as agentId
  • Disable the composer while isRunning or isLoading is true
  • Use TypeScript, no comments, no empty props

NEVER:

  • Invent a <WebChat /> component from @novu/react. It does not exist.
  • Use useChat from @ai-sdk/react. Web Chat uses useWebChat.
  • Compute HMAC hashes in the browser
  • Hardcode real API keys

Send a first message#

Call useWebChat inside NovuProvider. Render text parts, then send with sendMessage.

Omit conversationId to start a new chat. The first successful send creates the conversation.