> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.zorvia.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.zorvia.io/_mcp/server.

# Install the web SDK

> Load and initialize Zorvia Messenger on a website.

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

```html
<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.

```js
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.