useWebchat hook provides access to the Webchat client and its state. It allows you to:
- Interact with your bot
- Listen to real-time events
- Manage conversation lifecycle, user info, and messages
Usage
App.tsx
Parameters
Your Botpress project Client ID. Required to initialize the client and establish communication with the server.
Returned Values
The underlying client instance. Can be used to manually send events, fetch data, or interact with the server.
Represents the current connection state of the client.
Allows you to listen to client events such as incoming messages, typing indicators, or custom events.
Here are the native Webchat events that you can listen to: