Whoa Chat
Docs

The chat components

The merchant chat is the same set of components your team uses in the inbox: one thread, rich cards, files, reactions and live typing, drawn inside your embedded app.

Set up the host once

Call setChatHost once at startup, before the chat renders. Every field is optional.

FieldWhat it does
brandYour names and icon: app, appFull, team, bot, botFull, logo. Strings such as "Acme support" and the AI's byline use them.
priceBook(id) => { tiers }: your plans, for the pricing card your team can send.
deepLinkOptions() => [{ key, label }]: pages of your app your team can link to from a message.
import { setChatHost } from "@whoa-chat/react/host";

setChatHost({
  brand: { app: "Acme", appFull: "Acme Bundles", team: "Acme support", bot: "Acme", botFull: "Acme AI", logo: "/acme-icon.png" },
  deepLinkOptions: () => [{ key: "settings", label: "Settings" }],
});

Draw the thread

ChatThread from @whoa-chat/react/ChatThread draws the conversation and the composer. For the merchant's side, pass viewer="merchant", the messages (convert the API's with toView) and an onSend. Files, reactions and review cards take their own callbacks.

import { ChatThread } from "@whoa-chat/react/ChatThread";
import { toView } from "@whoa-chat/react/chatApi";

<ChatThread
  viewer="merchant"
  messages={messages.map((m) => toView(m, { cards: true }))}
  onSend={(body, fileIds) => api.send(body, fileIds, shopName, null)}
  uploadFile={api.upload}
  fileUrl={api.fileUrl}
  fetchFile={api.fetchFile}
  onReact={api.react}
  onTrack={(id, action, detail) => api.track(id, action, detail)}
/>

A ready-made launcher (the bubble, the panel and its polling) is on its way Coming soon. Until then, compose ChatThread, merchantChatApi and useLive in your own component.

Keep it live

api.thread() answers with a live address. Pass it to useLive from @whoa-chat/react/useLive with the same token getter: new messages arrive at once and your team's typing shows as dots.

import { useLive } from "@whoa-chat/react/useLive";

useLive({
  url: live,               // from api.thread()
  role: "merchant",
  token,                   // the cachedMerchantToken getter
  onEvent: (e) => { if (e.type === "update") reload(); },
});

api.thread(true) peeks without marking the thread read; api.thread(false) marks it read, for when the merchant has the chat open.

Theming

Import @whoa-chat/react/supportChat.css once. Colours, lines and the corner radius are CSS variables on :root; override them in your own stylesheet.

css
:root {
  --sc-ink: #1d1b16;
  --sc-line: #e7e2d8;
  --sc-surface: #ffffff;
  --sc-soft: #f6f3ee;
  --sc-radius: 18px;
}

Languages

The chat's texts come in 15 languages: Bulgarian, Chinese (simplified and traditional), Danish, Dutch, English, French, German, Italian, Japanese, Polish, Portuguese (Brazil and Portugal), Spanish and Swedish. They live under the i18next namespace whoaChat; load them with your app's i18next instance from @whoa-chat/react/locales. Messages your team writes are translated into the merchant's language automatically, with the original a tap away.