Vince
04/29/2024, 7:15 PMVapi Support
04/29/2024, 7:15 PMVapi Support
04/29/2024, 7:15 PM</body>
tag. Ensure you replace <assistant_id>
with your actual assistant ID and <your_public_api_key>
with your public API key from the Vapi Dashboard.
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>
Vapi Support
04/29/2024, 7:15 PMbuttonConfig
object to align with your site's branding and style. Adjust positioning, colors, icons, and more to ensure it fits naturally within your site's layout.
4. **Add Functionality to Vapi Instance**: Utilize the vapiInstance
for further customization, such as handling events or sending messages to the bot programmatically.
It’s essential to pay attention to the CSS and any other site-specific configurations that may conflict with the widget. If inserting the code snippet directly causes layout issues, consider adjusting the positioning and styling within the buttonConfig
object or consult Squarespace's documentation for embedding external scripts to ensure compatibility.
Remember to also check for any console errors in your browser's developer tools, as these can provide clues if the widget does not display or function correctly. If issues persist, reviewing common integration challenges discussed in forums like Discord might offer additional insights or solutions specific to Squarespace integration [(2)]() .Abed Malak
04/29/2024, 7:45 PMSahil
04/29/2024, 8:04 PMVince
04/30/2024, 8:05 PMVince
04/30/2024, 8:46 PMVince
04/30/2024, 9:24 PMVince
05/02/2024, 7:49 PMGurleen
05/02/2024, 9:05 PM