cheezymcsquibble
04/10/2025, 8:16 PMVapi Support Bot
04/10/2025, 8:17 PMmessage
event specifically for "receiving messages sent to the Server URL locally on the client, so you can show live transcriptions."
To set this up, you'll need to:
1. Configure your assistant's serverMessages
to include "transcript" like this:
json
{
"serverMessages": [
"transcript",
"end-of-call-report"
]
}
[(Source)](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1341440757189578782)
2. Listen for the message
event in your code and filter for messages with type === 'transcript'
. Here's an example of how you might implement this:
ts
useEffect(() => {
const handleMessage = (message) => {
if (message.type === 'transcript' && message.transcriptType === 'final') {
const { type, ...payload } = message;
setMessages((prevMessages) => [
...prevMessages,
{ role: payload.role, content: payload.transcript },
]);
}
};
vapi.on('message', handleMessage);
// Cleanup function
return () => {
vapi.off('message', handleMessage);
};
}, [vapi]);
[(Source)](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342498699615539222)
You'll also need to make sure transcripts are enabled in your assistant's artifactPlan with transcriptPlan.enabled: true
[(Source)](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342498699615539222).
Is there anything specific about implementing this feature that you'd like me to explain further?
Sources:
- [Vapi SDKs Documentation](https://docs.vapi.ai/sdks)Vapi Support Bot
04/10/2025, 8:18 PMcheezymcsquibble
04/10/2025, 8:34 PMKINGS BIG
04/11/2025, 7:33 PM