@onedeskpro/chatbot-react 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ export default function App() {
|
|
|
29
29
|
|
|
30
30
|
`ChatbotProvider` accepts every `ChatbotInitOptions` field as a prop — `apiKey`, `apiBaseUrl`, `chatbotName`, `primaryColor`, `theme`, `position`, `welcomeMessage`, `placeholder`, `autoOpen`, `requestTimeoutMs`. Only `apiKey` is required. The `sessionId` prop is deprecated and ignored.
|
|
31
31
|
|
|
32
|
-
`ChatbotWidget` handles the whole flow itself: it asks a new visitor for their name and phone number before the chat opens, and shows the controls and banners for handing a conversation to a human agent.
|
|
32
|
+
`ChatbotWidget` appears only once the Onedesk Pro server is reachable and the agent can reply; until then nothing is shown and `blockReason` says why. It handles the whole flow itself: it asks a new visitor for their name and phone number before the chat opens, and shows the controls and banners for handing a conversation to a human agent.
|
|
33
33
|
|
|
34
34
|
The components are client-side; in Next.js App Router they carry `'use client'` already, so importing them from a server component is fine as long as the provider itself renders on the client.
|
|
35
35
|
|
|
@@ -94,7 +94,7 @@ function SupportPanel() {
|
|
|
94
94
|
| `needsIdentify` | `true` until the visitor has identified. `sendMessage` rejects while it is. |
|
|
95
95
|
| `visitorToken`, `visitorName` | The identified visitor, or `null`. |
|
|
96
96
|
| `mode` | `'ai'`, `'waiting'`, `'human'`, or `'closed'`. |
|
|
97
|
-
| `blockReason`, `error` | Why the agent cannot answer, and the last error message. |
|
|
97
|
+
| `blockReason`, `error` | Why the agent cannot answer (for example `server-unavailable` or `no-credits`), and the last error message. |
|
|
98
98
|
| `submitIdentify({ name, phone, email? })` | Identifies the visitor and unlocks the chat. |
|
|
99
99
|
| `sendMessage(text)` | Sends a message. |
|
|
100
100
|
| `requestHuman()` | Escalates to a human agent. Does nothing unless `mode` is `'ai'` and a conversation has started. |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onedeskpro/chatbot-react",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "React SDK for the Onedesk Pro Chatbot",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Typetech IT <support@onedeskpro.com>",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"react-dom": ">=18.0.0"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@onedeskpro/chatbot-core": "0.2.
|
|
54
|
-
"@onedeskpro/chatbot-types": "0.2.
|
|
53
|
+
"@onedeskpro/chatbot-core": "0.2.1",
|
|
54
|
+
"@onedeskpro/chatbot-types": "0.2.1"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@microsoft/api-extractor": "^7.59.4",
|