0.4.1 • Published 5 months ago
@salla.sa/ui-merchant-salla-chat v0.4.1
Salla Chat Integration (For Partners)
A React-based project integrating Salla and Chatwoot for chat management, using TypeScript and React Query.
Features
- Fetch and paginate chat conversations via Salla API
- Integrate Chatwoot chat widget with custom settings
- TypeScript type safety for global objects and API responses
- React Query for efficient data fetching and caching
Tech Stack
- React
- TypeScript
- @tanstack/react-query
- Chatwoot
- Salla Bridge SDK
- Salla Admin UI
- Salla Utils
- Salla Styles
- Tailwind CSS
Getting Started
Prerequisites
- Node.js (v16+ recommended)
- npm
Installation
npm installRunning the Project
Running the ProjectBuilding for Production
npm run buildProject Structure
src/types/global.ts — Global TypeScript type declarations for window objects and Salla/Chatwoot integration. src/api/SallaChatAPI.ts — React Query hooks for fetching chat conversations from Salla. src/context — React context for Salla chat API requests.
Usage
Use the useGetChatList hook to fetch and paginate chat conversations. Global window objects (chatwootSDK, $chatwoot, chatwootSettings, salla) are typed for safe access.
Code Style
Enforced with project code style settings (.idea/codeStyles/Project.xml) 2-space indentation, trailing commas removed, spaces within object braces/imports
License
Salla.sa