ChatBubble Props
Dive into the detailed guide to understand and utilize the properties that can be passed to your Chat Bubble component for enhanced customization and control.
In the ChatBubble component, there are three main properties:
A chatHistory property to determine whether to display the chat history.
A chatUiVariant property to specify the chat variant to display.
A set of properties returned by
useConvaiClient
which are essential for fetching user and NPC texts.
The set of properties that are mandatory to be returned by the useConvaiClient (You can follow the JavaScript SDK tutorial to set up your own custom useConvaiClient hook) for the Chat Bubble to work as expected are:
npcText : Stores the text returned by Npc.
userText: Stores the user text.
convaiClient: Stores the state of convai client and is used by Chat Bubble to set session Id.
keyPressed: Changes whenever the user presses the key and starts speaking.
characterId: Used by the chat bubble to store and retrieve chat history.
setUserText: Used by Chat Bubble component to reset the Chat History.
setNpcText: Used by the Chat Bubble component to reset the Chat History.
setEnter: Used by the textbox to send the textbox content to the client whenever the user press enter.
These are the properties that can be optionally passed by the custom useConvaiClient hook. If you are using the inbuilt useConvaiClient hook you can use these properties:
npcName: Name that will be shown on the chat UI for your character.
userName: Name that will represent user on the chat UI.
gender: Returns the gender of your avatar ( Can be used to set up animations).
avatar: Gives the model link of your avatar which can be used to load your 3D model to the scene.
actionText: Returns the action text that represents the action Npc has been asked to perform.
There are 4 types of chat variants that you can choose from:
Toggle History Chat
Unified Compact Chat
Sequential Line Chat
Expanded Side Chat
Last updated