RealTimeX
Sign inStart for free
RealTimeXWeb Package
IntroductionPrerequisitesInstallationProject setupQuick start
Package structureConfigurationComponentsHooksAPI integrationSocket events
OverviewReplace entire UIReplace componentsStyle with classNamesThemes & localePhone & video callingIn-call control barFeatures
Unread badgeRich-text messagesPins, stars & datesMessage threadsMentionsCanvas & draftsNotificationsAdmin permissionsServer refusalsSession & token refresh
Host app integrationTroubleshootingFAQVersion historyBest practicesSupport & contact
Web packageHelp & reference

FAQ

Do I need a private npm token to install the package?

No. @realtimexsco/live-chat is published on the public npm registry, so no .npmrc file or private token is required. Install with npm, yarn, or pnpm like any other public package.

Why is the chat UI completely unstyled?

Unstyled UI almost always means Tailwind never scanned the package classes or the package stylesheet was never imported. Check this list in order:

  • Import @import "@realtimexsco/live-chat/styles.css" in your global CSS.
  • Import it once, globally - not in a CSS module and not only on some routes. No @source entries are needed; the stylesheet is pre-compiled.
  • Confirm --chat-theme (and related tokens) exist under :root.

Full CSS samples live in Project Setup; common symptoms are listed in Troubleshooting.

Can I use this package without Tailwind CSS?

Yes. Tailwind is optional - the package ships a pre-compiled styles.css with every class its components need, so you only import that file. The only peers are react and react-dom. Use Tailwind in your own app only if you want it for custom slots.

Do I have to customize every component?

No. Customization is entirely opt-in per slot. If you pass no components prop at all, the full default chat UI renders. Override only the slots you need - for example just Avatar or MembersDrawer - and leave the rest unchanged.

What happens if I pass components={{ MembersDrawer: undefined }}?

It is treated as if the key were not passed at all, and the package default drawer renders. To keep a slot at its default, omit the key entirely - do not pass undefined, null, or an empty placeholder component.

How do I replace the entire chat interface with my own design?

Pass components={{ ChatLayout: MyChatShell }} and either wrap DefaultChatLayout or build entirely from scratch using useChatController(). See Replace entire UI for both patterns.

Why does my sent message appear on both sides of the conversation?

This is caused by loggedUserDetails._id not matching the _id encoded in your JWT. The package uses that id to decide which bubbles are “mine” versus “theirs,” so a mismatch makes your own messages look like they came from someone else as well.

Decode the token (or use the id returned by your login API) and set loggedUserDetails._id to the same value. Project Setup includes a userIdFromToken helper you can copy into chat.config.ts.

Can I add my own query parameters to the package's API calls?

Yes. Use queryParams for shared values, queryParamApis to choose which APIs receive them, and queryParamsByApi for per-endpoint overrides. Equivalent imperative helpers are also available.

tsx
1<ChatMain2  {...chatConfig}3  queryParams={{ tenant: "acme" }}4  queryParamApis={["get"]}5  queryParamsByApi={{6    conversations: { includeArchived: false },7  }}8/>

Full patterns are documented in API Integration.

Does customizing query parameters affect the socket connection or file uploads?

The socket connection's own query string is never modified by queryParams / queryParamsByApi. File uploads are different: shared GET params do not automatically attach to presigned URL requests, but you can customize uploads explicitly with the presignedUrls key inside queryParamsByApi.

tsx
1queryParamsByApi={{2  presignedUrls: { folder: "chat-uploads" },3}}

Which package version do I need for full drawer customization?

Version 1.1.55 introduced wiring for drawer slots through resolveComponent; version 1.1.56 hardened the default-fallback logic. Use 1.1.56 or later whenever you replace MembersDrawer or related header drawers.

How do phone and video call buttons work?

Call buttons appear only in direct-message conversations (hidden for groups). The package renders the buttons and invokes your callbacks - you own the WebRTC / VideoSDK integration.

tsx
1features={{2  showPhoneCall: true,3  showVideoCall: true,4  onPhoneCall: ({ activeChannel, conversationId }) => {5    yourVoiceSDK.start(activeChannel.id, conversationId);6  },7  onVideoCall: ({ activeChannel, conversationId }) => {8    yourVideoSDK.start(activeChannel.id, conversationId);9  },10}}

More options (replace the whole button group, or hide calls) are in Phone & video calling.

Can I use this package with plain React (no Next.js)?

Yes - it works with Vite-based React apps as well as Next.js App Router projects. Follow Project Setup for framework-specific CSS and bundler config, then Quick Start for a working page.

PreviousTroubleshootingNextVersion history

On this page

Do I need a private npm token to install the package?Why is the chat UI completely unstyled?Can I use this package without Tailwind CSS?Do I have to customize every component?What happens if I pass components={{ MembersDrawer: undefined }}?How do I replace the entire chat interface with my own design?Why does my sent message appear on both sides of the conversation?Can I add my own query parameters to the package's API calls?Does customizing query parameters affect the socket connection or file uploads?Which package version do I need for full drawer customization?How do phone and video call buttons work?Can I use this package with plain React (no Next.js)?
Back to top