@ravenkash/chat
v0.1.0
Published
Raven browser SDK for real-time messaging — connect, send, and receive without writing a line of WebSocket code.
Readme
@ravenkash/chat
Raven's browser chat SDK — durable, ordered messaging with presence, typing indicators, read receipts, reactions, threads and attachments. Connect, send and receive without writing a line of WebSocket code.
Part of Raven, open-source real-time communication infrastructure.
Install
npm install @ravenkash/chatUse
The chat token is minted by your backend (POST /v1/chat/tokens) and is a
separate credential from an RTC token — neither works on the other plane.
import { createChatClient } from '@ravenkash/chat';
const chat = createChatClient({
token: grant.token,
apiUrl: grant.apiUrl,
});
await chat.connect({ room: 'room_123' });
chat.on('message', (message) => render(message));
await chat.sendMessage({ text: 'Hello' });Postgres is the source of truth, so history survives a reconnect and messages arrive in a defined order rather than whatever the socket delivered.
Exports
createChatClient, ChatClient, MessagesApi, AttachmentsApi,
isRavenChatError, and the message/presence/reaction types.
Documentation
- Chat SDK reference
- Chat overview · architecture · WebSocket protocol
- Presence · typing · read receipts · reactions · threads · attachments — one page each under
docs/chat/ - Runnable example:
examples/chat
License
MIT
