MaxKnox
05/14/2024, 3:51 PMVapi Support
05/14/2024, 3:51 PMVapi Support
05/14/2024, 3:51 PMjavascript
vapi.on('message', (msg) => {
if (msg.type !== 'transcript') return;
// Example code to send transcript data to Firebase
fetch('https://your-firebase-url.firebaseio.com/transcripts.json', {
method: 'POST',
body: JSON.stringify({
transcript: msg.transcript,
timestamp: new Date().toISOString(),
}),
headers: {
'Content-Type': 'application/json',
},
});
});
This example listens for transcript messages and sends them to a Firebase database, [(2)]() .MaxKnox
05/14/2024, 3:55 PMVapi Support
05/14/2024, 3:55 PMMaxKnox
05/14/2024, 3:56 PMSahil
05/14/2024, 4:28 PM