Web snippet not working
# support
r
Using the web snippet for https://docs.vapi.ai/examples/voice-widget. I made sure i'm using the correct assistant ID and public API key. I'm getting this error from the browser inspect console: https://cdn.discordapp.com/attachments/1241519757941805279/1241519758638321684/image.png?ex=664a7ee0&is=66492d60&hm=a5ca24a4663ffa0161aeb26a3bfd8a74ea43c9d388712e5cf727c2a35862cffc&
v
Hi @rahtid, I'm an AI assistant for Vapi. I'll analyze available sources and get back to you shortly.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Voice Widget Example]() * [Vapi Python SDK]() * [Provider Keys]() * [Dashboard]() -----------------------------
### Answer It appears you are experiencing issues with the Vapi Voice Widget snippet. To assist you further, I would need to know the specific error message you're seeing in the browser's console. This will help in pinpointing the exact issue. Commonly, errors could be related to network issues, incorrect API keys, or script conflicts. Make sure: 1. The API key and Assistant ID are correctly implemented as shown in the provided documentation [(1)]() . 2. There are no network issues or console errors related to loading external scripts. 3. No ad blockers or browser extensions that might block the script from loading. If you continue to face issues, checking the network tab in the browser's developer tools to see if the requests are being made successfully can also be helpful. If there are failed requests, the status codes and messages could provide more insights into what might be going wrong. Please provide the specific error from the console for more detailed assistance.
Got it. Tagging @User for additional help.
a
What is the best practice to add the web snippet to wordpress website. How to make it stick to the bottom right position.
s
Can you provide some code snippets so that we can reproduce it and solve your issue?
Through CSS
c
Use the plugin I created 🙂
a
plugin link?
c
Send me a message, I am walking people through it and testing.
It will take a few minutes.
r
@Sahil here is the code snippet I used for my web builder. Aimz and Chowder's convo are not related to my issue. var vapiInstance = null; const assistant = ""; const apiKey = ""; const buttonConfig = {}; // Modify this as required (function (d, t) { var g = document.createElement(t), s = d.getElementsByTagName(t)[0]; g.src = "https://cdn.jsdelivr.net/gh/VapiAI/html-script-tag@latest/dist/assets/index.js"; g.defer = true; g.async = true; s.parentNode.insertBefore(g, s); g.onload = function () { vapiInstance = window.vapiSDK.run({ apiKey: apiKey, // mandatory assistant: assistant, // mandatory config: buttonConfig, // optional }); }; })(document, "script"); I removed the assistant id and public api key of course.
8 Views