grumpy-cyan
grumpy-cyan5mo ago

Web Call integration not working in javascript

I’ve been trying to integrate the Vapi Web SDK into my platform so I can start a web call directly from a button in my app, but I’m running into issues. so i want to know if the SDK is still usable for web calls with agents, i do have the ID of the agent and the public key of the Vapi environment and i did follow the documentation (https://docs.vapi.ai/quickstart/web), but unfortunately the call starts and ends quickly and i get a "meeting Ended: ejected from meeting". I want to know if there's a correct way to integrate web call in my app. Any help is appreciated !
4 Replies
Vapi Support Bot
Yes, the Vapi Web SDK is still usable for web calls with agents.
Here's a minimal integration example:
import Vapi from '@vapi-ai/web';

const vapi = new Vapi('YOUR_PUBLIC_API_KEY');
document.getElementById('start-call').onclick = async () => {
await vapi.start('YOUR_ASSISTANT_ID');
};
import Vapi from '@vapi-ai/web';

const vapi = new Vapi('YOUR_PUBLIC_API_KEY');
document.getElementById('start-call').onclick = async () => {
await vapi.start('YOUR_ASSISTANT_ID');
};
Double-check that your assistant is published and your API key/assistant ID are correct. If you still get "ejected from meeting," verify your assistant's status in the dashboard and ensure your API key is valid. Sources: - Vapi Web SDK Quickstart - Vapi Web SDK Documentation
⤵️ Mention @Vapi Support Bot for follow-ups 🐥
Duckie
Duckie5mo ago
Message marked as helpful by @RamonJ! 🎉
grumpy-cyan
grumpy-cyanOP5mo ago
Thanks, i don't really know if it was from you or i was just tripping, but i saw that the documentation changed and it wasn't the one that i have been seeing these last few days, but it seems that it worked for me from the documentation and i just used plain html and js to test, now i think it should work on my next app, Thank you so much :vapilogo:
Kyle
Kyle5mo ago
Hey RamonJ, Glad the issue was resolved. Please reach out to us if you have any other questions regarding this issue

Did you find this page helpful?