@@ -83,17 +83,18 @@ Below is a list of available hooks along with a brief description for each of th
83
83
| Name | Description |
84
84
| ------------------- | --------------------------------------------------------------------------------------- |
85
85
| useAudio | Manages audio functionalities, such as toggling audio on or off. |
86
+ | useBotId | Allows retrieving of bot id (mainly for plugin developers). |
86
87
| useChatHistory | Handles loading, retrieving and setting of chat history messages. |
87
88
| useChatWindow | Manages the state of the chatbot window (open/close). |
88
89
| useFirstInteraction | Detects and tracks the user's first interaction with the chatbot. |
89
- | useFlow | Allows getting and restarting chatbot flow and tracks if flow has started. |
90
+ | useFlow | Allows retrieving and restarting chatbot flow and tracks if flow has started. |
90
91
| useMessages | Handles sending, clearing, and retrieving messages in the chatbot. |
91
92
| useNotifications | Manages chatbot notifications, such as toggling notifications on or off. |
92
93
| usePaths | Manages chatbot conversation paths, such as navigation |
93
94
| useSettings | Accesses and modifies chatbot settings. |
94
95
| useStyles | Accesses and modifies chatbot styles. |
95
96
| useTextArea | Manages the text input area of the chatbot, including setting and clearing values. |
96
- | useToasts | Manages toasts shown within the chatbot, such as showing or missing them. |
97
+ | useToasts | Manages toasts shown within the chatbot, such as showing or missing them. |
97
98
| useVoice | Manages voice functionality, such as toggling voice on or off |
98
99
99
100
## Hook Details
@@ -126,6 +127,29 @@ const MyNestedComponent = () => {
126
127
};
127
128
```
128
129
130
+ ### useBotId
131
+
132
+ #### Description
133
+ The ` useBotId ` hook allows you to retrieve the bot id (mainly for plugin developers).
134
+
135
+ #### Return Values
136
+ | Name | Type | Description |
137
+ | -------------- | ----------- | ------------------------------------------------------ |
138
+ | getBotId | ` function ` | Retrieves the bot id. |
139
+
140
+ #### Code Example
141
+ ``` jsx
142
+ import { useBotId } from " react-chatbotify" ;
143
+
144
+ const MyNestedComponent = () => {
145
+ const { getBotId } = useBotId ();
146
+
147
+ return (
148
+ < button onClick= {getBotId}>< / button>
149
+ )
150
+ };
151
+ ```
152
+
129
153
### useChatHistory
130
154
131
155
#### Description
@@ -191,11 +215,11 @@ import { useEffect } from "react";
191
215
import { useFirstInteraction } from " react-chatbotify" ;
192
216
193
217
const MyNestedComponent = () => {
194
- const { hasFlowStarted } = useFirstInteraction ();
218
+ const { hasInteractedPage } = useFirstInteraction ();
195
219
196
220
useEffect (() => {
197
- // do something if flow has started
198
- }, [hasFlowStarted ])
221
+ // do something if has interacted
222
+ }, [hasInteractedPage ])
199
223
200
224
return (
201
225
< ExampleComponent/ >
0 commit comments