@convo-sco/sdk-react
Drop-in real-time chat UI for React and Next.js — direct messages, group chats, reactions, replies, forwarding, pinned/starred messages, and more. Built on Socket.IO, Zustand, Tailwind CSS v4, and Radix UI.

|
|
| Package |
[@convo-sco/sdk-react](https://www.npmjs.com/package/@convo-sco/sdk-react) |
| Styles |
@convo-sco/sdk-react/styles.css |
| Requires |
React 17+, Tailwind CSS v4 |
| Docs |
Package documentation |
| License |
MIT |
Socket.IO, REST client, Radix UI, Lexical (rich-text composer + message viewer), DOMPurify, emoji picker, Zustand, react-hot-toast, VideoSDK, Firebase, react-easy-crop, and chat UI ship as dependencies of this package — they install with @convo-sco/sdk-react and are removed when you uninstall it. Your app only supplies peer deps it already owns: React, React DOM, and Tailwind CSS v4.
Vite + pnpm (calling): also install @videosdk.live/react-sdk at the same version this package uses (^0.13.3) as a direct app dependency and add it to optimizeDeps.include — pnpm does not hoist nested deps, and without Vite pre-bundling, React 19's scheduler throws unstable_NormalPriority. Do not grab @latest: VideoSDK 1.x changed joinWithoutUserInteraction to auto-join, which double-joins against this package's own join() (ERROR_OPERATION_IN_PROGRESS). See docs/chat_pakage_guide.md.
Install
npm install @convo-sco/sdk-react react react-dom tailwindcss
Vite: npm i -D @tailwindcss/vite · Next.js: npm i -D @tailwindcss/postcss
Quick start
- Import CSS —
@import "@convo-sco/sdk-react/styles.css" and add Tailwind @source for the package dist files.
- Create
chat.config.ts with clientId, accessToken, loggedUserDetails, apiUrl, socketUrl.
- Render
<ChatMain {...chatConfig} />.
import ChatMain from "@convo-sco/sdk-react";
import { chatConfig } from "@/configs/chat.config";
export default function ChatPage() {
return (
<div className="h-dvh min-h-0 overflow-hidden">
<ChatMain {...chatConfig} viewportHeight="screen" />
</div>
);
}
Demo mode (no server)
Try the full UI with sample data and no backend. Useful for product demos, design reviews, Storybook and screenshots.
<ChatMain demo viewportHeight="screen" />
// With options
<ChatMain
demo={{
user: { name: "Jordan" }, // the signed-in demo user (default "You")
autoReply: true, // contacts type, then answer (default true)
replyDelayMs: 1400, // how long they "type" (default 1400)
simulateActivity: true, // occasional messages in other chats (default true)
}}
/>
To show your own signed-in user in the demo (header, settings, member lists), pass loggedUserDetails. The demo reads name (or firstName + lastName), email and image (or profileImage / avatar), and demo.user overrides it field by field:
<ChatMain demo loggedUserDetails={{ name: "Jordan Lee", email: "jordan@acme.com", image: "/me.png" }} />
Changing loggedUserDetails or the demo options later updates the running demo in place. The UI picks up the new name, avatar or behaviour right away, and nothing resets: no reload, no reconnect, and no lost messages. clientId, accessToken, apiUrl and socketUrl are not needed and are ignored while demo is on. <Chat demo> (also exported as ChatProvider) works the same way.
The demo has 6 sample users, 4 direct chats and 2 groups. These work: sending, replies, typing indicators, read receipts, reactions, edit, delete, pin, star, forward, search, attachments (kept in the browser), creating and editing groups, block and unblock, and unread badges. Everything lives in memory and resets on reload. Calls, canvas, whiteboard and threads are turned off in demo mode because they need a real server. isDemoMode() tells you whether it is on.
Small first load
Heavy features download only when first used: calls, the canvas editor, the emoji picker, the calendar, image editing, HEIC conversion, drawers and dialogs. A typical app downloads about a third less with the chat (1.49 MB instead of 2.25 MB, minified). Nothing to configure and nothing extra to install. While a feature downloads, a small loading indicator shows. If the download fails, the feature offers Try again, and onError receives code: "feature_load_failed". Use the ESM entry (the default for Vite and Next.js) to benefit; the CommonJS build stays a single file.
Themes and design tokens
Restyle the whole chat (light and dark, menus, dialogs, call screen) without touching the package:
// A built-in preset: default, ocean, forest, sunset, rose, midnight, graphite, high-contrast
<ChatMain {...chatConfig} themePreset="ocean" />
// Your own brand theme, built on a preset
import { defineChatTheme } from "@convo-sco/sdk-react";
const acme = defineChatTheme({
name: "acme", label: "Acme", extends: "graphite", themeColor: "#ff6a00",
tokens: { light: { "--chat-bubble-radius": "16px" }, dark: { "--chat-canvas": "#0c0c0d" } },
});
<ChatMain {...chatConfig} themePreset={acme} />
Or set CSS variables in your own stylesheet, on .chat-shell, .chat-theme-scope (and .chat-shell.dark, .chat-theme-scope.dark for dark mode). buildChatThemeCss(theme) turns any preset or custom theme into that stylesheet. CHAT_THEME_TOKENS lists every token with a description, and themeTokens autocompletes the names. Host props win over the preset: themeColor, fontFamily, sectionBorderRadius, then themeTokens on top.
Your own text (translations)
Every piece of text in the chat (buttons, menus, tooltips, placeholders, toasts, errors, empty states, the call screen) has a key. Replace any of them; the rest stays English:
<ChatMain
{...chatConfig}
translations={{
"common.cancel": "Cancelar",
"messages.empty.title": "Aún no hay mensajes",
"header.lastSeen": "Visto por última vez {time}",
}}
/>
Which key? docx/TRANSLATIONS.md lists every key with its English text: search it for the words you see on screen. ChatTranslations type-checks and autocompletes your keys. Pass a new object to switch language live. In your own components, useChatT() returns the same translator. See the guide for placeholders and plurals.
Features
DMs · groups · Socket.IO · reactions · replies · forward · edit/delete · pin/star · attachments · search · typing · read receipts · light/dark · locale/timezone · full UI customization
More information
HEIC images
Browsers other than Safari cannot show HEIC or HEIF photos, so the package handles them for you:
- Files added to the composer, a canvas, or a group photo are converted to JPEG before upload. Your backend and admin type rules see
image/jpeg.
- HEIC images sent by other clients are decoded for display. This fetches the image from the browser, so your storage bucket must allow
GET from your app's origin (CORS).
- If your site sets a Content-Security-Policy, add
worker-src blob:. The decoder runs in a worker created from a blob.
The decoder is about 3 MB and only loads when a HEIC file appears. For your own UI, the package exports DisplayImage (an <img> that can show HEIC), isHeicFile, and normalizeHeicFile:
import { DisplayImage, normalizeHeicFile } from "@convo-sco/sdk-react";
const jpeg = await normalizeHeicFile(file); // Returns other file types unchanged.
<DisplayImage src={url} fileName={name} alt={name} />;
License
The MIT License (MIT)
Copyright (c) 2026 Convo
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.