@alphinex/chat
v1.0.6
Published
Chat shell UI (message list, composer, presence) against a pluggable ChatTransport — the real-time transport itself is deferred, see ADR-0015. See documentation/PRODUCT-RESEARCH-MASTER-PLAN.md §10.1 (Sprint 25).
Downloads
104
Readme
@alphinex/chat
Chat shell UI (message list, composer, presence list) against a pluggable ChatTransport. The
real-time transport itself (Reverb, plain WebSocket, ...) is deliberately not decided by this
package — see ADR-0015.
Usage
import { ChatShell, MockChatTransport } from "@alphinex/chat";
import { useMemo } from "react";
function SupportChat() {
const transport = useMemo(() => new MockChatTransport({ id: "me", name: "Ada Lovelace" }), []);
return <ChatShell transport={transport} currentUserId="me" />;
}useChatShell is the headless layer underneath, if you want a custom chat UI.
Bringing your own transport
Implement ChatTransport (connect/disconnect/sendMessage/onMessage/onPresenceChange)
against whatever real-time backend your app uses — a Laravel Reverb WebSocket connection, a
generic WebSocket, Server-Sent Events, or polling. ChatShell/useChatShell don't know or care
which one is behind the interface.
Known limitations (Sprint 25 scope — see ADR-0015)
- No message persistence, pagination, or history loading —
useChatShellonly holds messages received since it connected. - No typing indicators, read receipts, or file attachments.
MockChatTransportis in-memory only; it does not simulate network latency or failure modes.
