You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the vapiInstance object can access start(), stop(), send(), etc.. but setMuted is not accessible despite it being built directly from the sdk. It appears that function was simply not exposed but even when i tried the following:
function initializeVapi(vapiObject, assistant, buttonConfig) {
console.log("Vapiobject: ", vapiObject);
var vapiInstance = vapiObject.run({
apiKey: "my api key",
assistant: assistant,
config: buttonConfig,
});
console.log("setMuted directly:", vapiInstance.setMuted);
vapiInstance.setMuted = function(muted) {
const sdk = window["@vapi-ai/web"]|| window.vapiSDK;
console.log("vapiInstance methods: ", Object.keys(vapiInstance));
console.log("SDK methods: ", Object.keys(vapiObject));
if (sdk && sdk.setMuted) {
sdk.setMuted(muted);
} else {
console.error("setMuted function not available in the SDK");
}
};
console.log("vapiInstance methods: ", Object.keys(vapiInstance));
const vapi_widget = document.getElementById("vapi-support-btn");
vapi_widget.classList.add("override-position");
setupEventListeners(vapiInstance);
setupPauseButton(vapiInstance);
}
setMuted is not accessible via that sdk object either which is just the script. when i add that, setMuted becomes an accessible method in Object Keys but thts just in the vapiInstance object. That does not fix the issue that the sdk object itself cannot access it. To clarify, it doesn't matter wether i use window["@vapi-ai/web"] or window.vapiSDK, setMuted is not accessible in either. That was more of debugging code a while back and i'm using django framework and just installed npm so my setup is a little wonky. everything works perfectly except for whatever reason i cannot access setMuted() or isMuted(). Can anyone help me with this? It appears to just not be exposed in the vapiInstance object so i thought i could access directly from the sdk object and define the function myself through vapiInstance but all that does is make the function an accessible method but not actually functional. This is the very last thing I need to complete my web app and it's the only thing thats giving me a headache about this. I love the platform so much and it's fantastic, I really need to find a way to make this work in the widget as soon as possible. I can provide all of my code if needed, the fact of the matter is that through the sdk object i can't even access it which is a red flag off the bat. If it's not accessible there, there's nowhere else I would be able to get it. Thanks so much!
The text was updated successfully, but these errors were encountered:
As instructed by the widget docs, i am utilizing the script of "https://cdn.jsdelivr.net/gh/VapiAI/html-script-tag@latest/dist/assets/index.js" which i was told could be outdated.
the vapiInstance object can access start(), stop(), send(), etc.. but setMuted is not accessible despite it being built directly from the sdk. It appears that function was simply not exposed but even when i tried the following:
setMuted is not accessible via that sdk object either which is just the script. when i add that, setMuted becomes an accessible method in Object Keys but thts just in the vapiInstance object. That does not fix the issue that the sdk object itself cannot access it. To clarify, it doesn't matter wether i use window["@vapi-ai/web"] or window.vapiSDK, setMuted is not accessible in either. That was more of debugging code a while back and i'm using django framework and just installed npm so my setup is a little wonky. everything works perfectly except for whatever reason i cannot access setMuted() or isMuted(). Can anyone help me with this? It appears to just not be exposed in the vapiInstance object so i thought i could access directly from the sdk object and define the function myself through vapiInstance but all that does is make the function an accessible method but not actually functional. This is the very last thing I need to complete my web app and it's the only thing thats giving me a headache about this. I love the platform so much and it's fantastic, I really need to find a way to make this work in the widget as soon as possible. I can provide all of my code if needed, the fact of the matter is that through the sdk object i can't even access it which is a red flag off the bat. If it's not accessible there, there's nowhere else I would be able to get it. Thanks so much!
The text was updated successfully, but these errors were encountered: