sorock
04/25/2024, 11:28 AMVapi Support
04/25/2024, 11:28 AMVapi Support
04/25/2024, 11:28 AM</body>
tag:
html
<script>
var vapiInstance = null;
const assistant = "<assistant_id>"; // Substitute with your assistant ID
const apiKey = "<your_public_api_key>"; // Substitute with your Public key from Vapi Dashboard.
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");
</script>
[(1)]()
This code snippet helps you easily integrate the Voice Widget into your website for enhanced user interaction. Make sure to replace <assistant_id>
and <your_public_api_key>
with your actual assistant ID and API key from the Vapi dashboard.
If you continue to face issues, it might be helpful to review the documentation for any updates or changes to the widget integration process.Sahil
04/25/2024, 11:37 AM