@dhatvibs/consumer-chat-sdk
v1.0.3
Published
Consumer help-center chatbot SDK for React Native
Maintainers
Readme
@dhatvibs/consumer-chat-sdk
Plug-and-play support chatbot and help center for consumer apps built with React Native.
Installation
npm install @dhatvibs/consumer-chat-sdk
# peer deps (if not already installed)
npm install axios react-native-svgUsage
import ConsumerChatSDK from '@dhatvibs/consumer-chat-sdk';
<ConsumerChatSDK
token={token} // Required: JWT from authentication
onClose={() => {}} // Optional: dismiss the SDK (e.g. close a modal)
/>Props
| Prop | Type | Required | Description |
|---|---|---|---|
| token | string | ✅ | JWT token used for authentication (contains userId) |
| onClose | () => void | ❌ | Called when user taps the close button |
Flow
ConsumerChatSDK
└─ OrderListScreen (Help & Support Center)
├─ Home View (Top 3 Orders, FAQ Categories)
├─ All Orders View
├─ FAQ Category View (List of questions)
├─ FAQ Answer View (Question and answer text)
└─ Tap order → startSession() → ChatScreen
├─ GUIDED mode
├─ FREE_CHAT mode
└─ RESOLVED modeAPI Endpoints Used
| Method | Endpoint |
|---|---|
| GET | /consumer/api/chat/orders/recent (example) |
| POST | /consumer/api/chat/start (example) |
| POST | /consumer/api/chat/resolve (example) |
| POST | /consumer/api/chat/message (example) |
Publishing
npm login
npm publish --access public