Package Reference
Installation
Step 1 — Install the package and its peers
Install the package and its peer dependencies with your preferred package manager:
shell
npm install @realtimexsco/live-chat react react-dom zustand tailwindcssStep 2 — Install the Tailwind v4 plugin for your framework
Vite projects:
shell
pnpm add -D @tailwindcss/vite @vitejs/plugin-react viteNext.js projects:
shell
pnpm add -D @tailwindcss/postcss
# next is usually already installedStep 3 — Verify the install
Confirm the package resolved and TypeScript types are available:
shell
npm ls @realtimexsco/live-chat
ls node_modules/@realtimexsco/live-chat/dist/index.d.ts # TypeScript types must existStep 4 — Configure CSS, the config file, and your chat page
Installation alone is not enough — the UI needs Tailwind v4 scanning, theme CSS variables, and a config object with credentials. Complete these next:
- Add Tailwind imports,
@sourcepaths, and--chat-theme*tokens — follow Project Setup. - Create
chat.config.tswithclientId, access token,loggedUserDetails,apiUrl, andsocketUrl. - Render
<ChatMain {...chatConfig} />inside a height-bounded page — see Quick Start.
Step 5 — Run your app
Start your Vite or Next.js dev server and open the route that renders ChatMain. You should see the default chat shell once CSS and credentials are correct.