๐ Welcome to XHub Chat
Modern, type-safe chat SDK for building real-time messaging experiences in React and beyond.
โจ Why XHub Chat?โ
XHub Chat provides a comprehensive suite of tools for building real-time chat applications with ease. Whether you're building a small team chat or a large-scale messaging platform, XHub Chat has you covered.
Core Strengthsโ
Type-Safe
Built with TypeScript for full type safety and IntelliSense support throughout your development workflow.
Real-Time
WebSocket-based communication with sliding sync, automatic reconnection, and optimistic UI updates.
Offline-First
Built-in IndexedDB caching ensures your app works seamlessly offline and syncs when back online.
Developer Experienceโ
- ๐ Framework Agnostic Core - Use with React, Vue, Angular, or vanilla JavaScript
- ๐ช React Hooks - Powerful, easy-to-use hooks for seamless React integration
- ๐ฆ Modular Architecture - Use only what you need, fully tree-shakeable exports
- ๐งช Well Tested - Comprehensive test coverage with Jest and TypeScript
- ๐ Extensive Documentation - Detailed guides, API references, and real-world examples
- ๐จ Modern Tooling - Built with latest TypeScript, bundled with tsup
๐จ Core Featuresโ
๐ฑ For All Developers
- ๐ญ Event-driven architecture
- ๐ Extensible plugin system
- ๐พ IndexedDB caching for offline support
- ๐ฌ Message reactions and threading
- ๐ Room management and presence
- ๐ File attachments and media
- ๐ Push notifications support
- ๐ End-to-end encryption ready
โ๏ธ For React Developers
useXHubChat- Core chat client accessuseRooms- Room list managementuseTimeline- Message timeline with paginationuseReactions- Message reactions handlinguseThread- Thread managementuseTyping- Typing indicatorsusePresence- User presence tracking- And many more custom hooks...
๐ฆ Packagesโ
๐ฆ @xhub-chat/core
Framework-agnostic core chat functionality with WebSocket support, event handling, and storage.
Perfect for: Building chat on any platform or framework
Learn more โ
@xhub-chat/react
React hooks and components for seamless integration with the core SDK.
Learn more โ๐ Quick Startโ
Get started in less than 5 minutes:
# Install packages
pnpm add @xhub-chat/core @xhub-chat/react
# Or with npm
npm install @xhub-chat/core @xhub-chat/react
# Or with yarn
yarn add @xhub-chat/core @xhub-chat/react
import { XHubChatProvider, useXHubChat, useRooms } from '@xhub-chat/react';
function App() {
return (
<XHubChatProvider config={{ baseUrl: 'https://api.example.com' }}>
<ChatApp />
</XHubChatProvider>
);
}
function ChatApp() {
const client = useXHubChat();
const { rooms, loading } = useRooms();
return (
<div>
<h1>My Rooms</h1>
{loading ? (
<p>Loading...</p>
) : (
rooms.map(room => (
<div key={room.roomId}>{room.name}</div>
))
)}
</div>
);
}
๐ What's Next?โ
๐ค Community & Supportโ
- GitHub: XHub-Platform/xhub-chat
- Issues: Report bugs
- NPM: @xhub-chat/core
๐ Licenseโ
XHub Chat is proprietary software ยฉ 2025 TekNix Corporation. All rights reserved.