Wordpress & VAPI Widget - Can a button open the wi...
# support
i
I have the VAPI voice widget on my site working. I'm looking to have a buttom pop open the widget in addition to clicking on the chat widget. Any idea how I can get the widget to open from another element on the page? I'm using Divi theme if that helps Thank you
v
You can trigger the Vapi widget to open from another button by simulating a click on the widget element. Add an ID to your button (e.g.,
open-vapi-widget
) and use this JavaScript:
Copy code
javascript
document.getElementById('open-vapi-widget').addEventListener('click', function() {
  document.querySelector('vapi-widget')?.click();
});
This will "click" the widget programmatically, opening it just like a user click. For best results, ensure your widget is already loaded on the page. Source: - [Vapi Web Widget Documentation](https://docs.vapi.ai/chat/web-widget)
v
I can help you set this up by linking the VAPI widget’s open function to any button on your Divi site. This is done with a small JavaScript snippet that triggers the widget when clicked. That way, you’re not limited to only the default chat widget. Do you prefer adding a short code snippet in Divi or a no-code solution? @IBIZ
i
Hello all, Develop a plugin for the VAPI user: https://github.com/imranhoshain/voice-ai-agent-for-vapi You can use it from here.
2 Views