@dhatvibs/vendor-chat-sdk
v1.0.1
Published
vendor help-center chatbot SDK for React Native
Downloads
209
Maintainers
Readme
@dhatvibs/vendor-chat-sdk
Plug-and-play support chatbot and help center for vendor apps built with React Native.
Installation
npm install @dhatvibs/vendor-chat-sdk
# peer deps (if not already installed)
npm install axios react-native-svgUsage
import VendorChatSDK from '@dhatvibs/vendor-chat-sdk';
<VendorChatSDK
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
VendorChatSDK
└─ 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