Skip to content

fix: map the chat-end-message attribute in the embed - #40

Open
blaab2 wants to merge 1 commit into
VapiAI:mainfrom
blaab2:fix/chat-end-message-attribute
Open

blaab2 wants to merge 1 commit into
VapiAI:mainfrom
blaab2:fix/chat-end-message-attribute

Conversation

@blaab2

@blaab2 blaab2 commented Sep 25, 2026

Copy link
Copy Markdown

Problem

chatEndMessage is a documented VapiWidget prop, and it works when the React component is used directly. The embed's attribute → prop map in src/widget/index.ts has no entry for it, though. So <vapi-widget chat-end-message="…"> and data-chat-end-message="…" are silently ignored, and the chat-ended screen always shows the hard-coded default, "This chat has ended. Thank you." We hit this on a German/French site, where that one sentence stayed in English.

Comparing VapiWidgetProps with the map, chatEndMessage is the only non-callback prop without an attribute.

Change

A single line in the map: 'chat-end-message': 'chatEndMessage', next to chat-first-message.

Tests

The existing embed specs don't reach the chat-ended screen (that needs a live assistant), so there's nothing to extend here. We confirmed the fix downstream with a Playwright test that stubs the /chat/web stream, clicks End Chat, and reads the end-screen text.

npm run lint, npm run type-check, npm run format:check and npm run test:ci pass.

Related: #38 (localizable labels), #39 (GFM markdown). All three are independent and apply cleanly on main.

🤖 Generated with Claude Code

`chatEndMessage` is a documented VapiWidget prop, but the embed's
attribute map had no entry for it, so `<vapi-widget chat-end-message=…>`
and `data-chat-end-message` were silently ignored and the chat-ended
screen always read "This chat has ended. Thank you.". It is the only
non-callback prop missing from the map.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
blaab2 added a commit to blaab2/client-sdk-react that referenced this pull request Sep 25, 2026
Adds the chat-end-message attribute mapping (VapiAI#40)
on top of VapiAI#38 and VapiAI#39; dist/ rebuilt and committed as before.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant