@v-office/website-chat
v1.1.0
Published
The AI chat of v-office websites: a launcher and a lazily loaded chat panel in a Shadow DOM, talking to the AI Studio chat service, and the json-render catalog (./catalog) the service places its rental cards, stays and links from. Styled through CSS custo
Readme
@v-office/website-chat
The AI chat of a v-office website. A visitor asks for a stay; the chat searches the agency's rentals, shows them as cards with the PMS's prices, and links each stay to its rental page with the dates and party filled in. It never books and has no form of its own.
Peers: React ^19.2.3, @v-office/website-headless >=1.1.0 <2. Sites pin exact versions.
Entry points
| Import | Contents |
| :------------------------------- | :-------------------------------------------------------------- |
| @v-office/website-chat | WebsiteChat, DEFAULT_COPY, CHAT_THEMES, CHAT_LOCALES |
| @v-office/website-chat/catalog | the json-render catalog and wire protocol, for the chat service |
Adding the chat to a site
Render WebsiteChat once in the layout as a client island; see instructions/versions/1.0.0/MIGRATION.md.
<WebsiteChat client:idle endpoint={import.meta.env.PUBLIC_CHAT_ENDPOINT} locale="de"
searchPath="/suche" contactPath="/kontakt" />| Prop | Required | Meaning |
| :------------ | :------- | :----------------------------------------------------------------------- |
| endpoint | yes | import.meta.env.PUBLIC_CHAT_ENDPOINT, which AI Studio's builds set |
| locale | yes | "de" or "en" |
| searchPath | yes | the site's search, for a rental without a page and when the chat is down |
| contactPath | yes | the site's contact page |
| theme | no | classic (default), soft or minimal: shadows or borders, how round |
| colors | no | { primary, secondary, accent }, any CSS colour, over the site's tokens |
| position | no | the entry pill and the panel on the right (default) or left |
| copy | no | overrides of single fields of DEFAULT_COPY (strings, suggestions) |
The chat stays hidden until an agent switches it on for the website in AI Studio.
It takes its colours and corners from the site's shadcn tokens (--primary,
--primary-foreground, --background, --foreground, --muted, --muted-foreground, --border,
--radius), dark mode included, and its own values where a site has none. A site whose corners
are square (--radius: 0) gets square buttons too.
A site with a sticky header sets --chat-top (its height) on any element around the widget, such as
:root: the dimmed page and the panel start below it. --chat-width widens the panel on wide screens
(default 700px).
The service places these components in replies: RentalCard (photo gallery, rating, the wishes the
search that found it applied), RentalCarousel, Compare, StayQuote, PriceBreakdown,
AlternativeStays, AvailabilityCalendar, PriceCalendar, ReviewSummary, RentalFacts,
RentalMap, StayLink, ContactLink and QuickReplies. They all read the PMS's data by id; none takes a price, a URL or
free text from the AI (QuickReplies' short answers excepted). RentalMap loads its map (MapLibre,
OpenFreeMap tiles) only when the visitor taps it.
Development
pnpm check && pnpm build && pnpm testSee AGENTS.md and docs/internal/releasing/overview.md.
