infall-chatbot-widget
v1.0.25
Published
A modern React chat widget component for customer support
Maintainers
Readme
Infall Chatbot Widget
A React chat widget for customer support with real-time messaging.
Installation
npm install infall-chatbot-widgetQuick Start
import ChatWidget from 'infall-chatbot-widget'
function App() {
return (
<ChatWidget
fullname="John Doe"
userId="john123"
partner="PVI"
/>
)
}Required Props
| Prop | Type | Description |
|------|------|-------------|
| fullname | string | User's full name |
| userId | string | Unique user ID |
| partner | string | Partner code (PVI, ABC, etc.) |
Optional Props
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| title | string | "Support Chat" | Chat title |
| primaryColor | string | "blue" | Theme color |
| position | string | "bottom-right" | Widget position |
Environment Variables
VITE_API_BASE_URL=http://localhost:5000/v1/apiFeatures
- 💬 Real-time messaging
- 🤖 AI-powered conversation titles
- 🔔 Sound notifications
- 📋 Conversation history
- 🔗 Shareable chat links
Troubleshooting
Common Issues
1. "useAuth must be used within an AuthProvider"
// ✅ Use default import
import ChatWidget from 'infall-chatbot-widget'
// ❌ Don't use named import
import { ChatWidgetComponent } from 'infall-chatbot-widget'2. WebSocket Connection Failed
- Check
VITE_API_BASE_URLenvironment variable - Ensure API server is running
3. User Not Authenticated
- Make sure all required props are provided
- Check browser console for errors
API Endpoints Required
GET /v1/api/user/userid/:userId- Get/create userGET /v1/api/conversation/user/:userId/partner/:partner- Get conversationsPOST /v1/api/conversation- Create conversationPOST /v1/api/message- Create messageGET /v1/api/faq- Get FAQs
Development
npm install
npm run build:lib
npm run devLicense
MIT
