Can I append the Web Snippet on a custom ID or cla...
# support
v
@nitiz143 Absolutely! You can append the Web Snippet to a custom ID or class attribute in your HTML document. To do this, you would typically target the specific element using JavaScript and insert the snippet accordingly. If you need guidance on how to implement this, please provide me with more details about your setup or the specific code snippet you're working with, and I'd be happy to assist you further!
You can continue this conversation by mentioning me in the message.
Got it. Tagging @User for additional help.
n
I want to append it on the attribute id ="Call"
Copy code
<div id="Call"></div>


<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>