Skip to navigation

Install the web SDK

View as Markdown

Get the widget URL, workspace URL, and public messenger key from your Zorvia Messenger channel’s Installation screen.

Add the SDK

Place this script near the end of your page’s <body>:

<script>
const script = document.createElement("script");
script.src = "YOUR_WIDGET_URL";
script.async = true;
script.onload = function () {
window.zorvia.init({
workspaceUrl: "https://{workspace}.zorvia.io",
livechatKey: "YOUR_PUBLIC_MESSENGER_KEY",
}).catch(function (error) {
console.error("Zorvia Messenger: failed to initialize", error);
});
};
script.onerror = function () {
console.error("Zorvia Messenger: failed to load the SDK");
};
document.body.appendChild(script);
</script>

The SDK downloads the channel’s saved appearance and behavior settings during initialization. Explicit options passed to init() override saved settings.

Single-page applications

Load the script once when your application shell mounts. Before removing the integration, call window.zorvia.destroy() and then remove the script element.

window.zorvia.destroy();
script.remove();

Domain restrictions

If your channel restricts allowed domains, add every production and preview hostname in Zorvia. The SDK rejects initialization with a forbidden error when the current domain is not allowed.