@osvi-ai/chat
v0.1.6
Published
Embed an Osvi AI chat agent on any website: headless client, Web Components and a script-tag widget.
Readme
The @osvi-ai/chat package provides three entry points: @osvi-ai/chat for the headless SDK, @osvi-ai/chat/ui for the Web Components UI, and dist/widget.js as a script-tag widget artifact. See the Website Chat guide to get started.
Pre-chat details
When the agent's pre-chat form is on, the visitor's name and phone are sent to the agent's workspace (POST /v1/public/chat/session/:id/visitor) and the form is replaced by the composer once that succeeds. A failed save keeps the form open with a retryable error.
After a successful save the panel fires a bubbling, composed osvi-prechat event with detail: { name?: string; phone?: string } (only the fields the form asked for). The SDK keeps only a "submitted" flag in localStorage under osvi.chat.prechat.<agentId>, never the name or phone, so a returning visitor is not asked again and the event is not fired again on restore.
