Copy this snippet into your HTML page, replacing the placeholder values with your own credentials:
<script>
var sulusInstance = null;
const assistant = "<assistant_id>"; // Substitute with your assistant ID
const apiKey = "<your_public_api_key>"; // Substitute with your Public key from the Sulus dashboard
const buttonConfig = {}; // Modify this as required
(function (d, t) {
var g = document.createElement(t),
s = d.getElementsByTagName(t)[0];
g.src =
"https://cdn.sulus.ai/html-script-tag/latest/dist/assets/index.js";
g.defer = true;
g.async = true;
s.parentNode.insertBefore(g, s);
g.onload = function () {
sulusInstance = window.sulusSDK.run({
apiKey: apiKey, // mandatory
assistant: assistant, // mandatory
config: buttonConfig, // optional
});
};
})(document, "script");
</script>
The script dynamically loads the SDK from the CDN with defer and async so it doesn't block page rendering. Once loaded, window.sulusSDK.run() initializes the widget and the floating call button appears on the page automatically — you don't need to add any extra HTML for it. The returned sulusInstance can be used to control the widget programmatically afterward.