Preparing the Widget for Integration
First connect the regular widget and make sure it opens on the website. An agent is not required for this: without an agent, visitors can message the project and team members can continue the conversation in the Cabinet. Connect an agent only when visitors need automatic AI replies.
1. Connect the Regular Widget
- Create a Widget channel. In the creation form, enter the domain of the site where the chat will run.
- If the channel already exists, check the list under Channel Name, Icon, and Domains. The widget does not accept requests from domains that are not on this list.
- Configure the appearance and save the channel.
- Open Embed Code, select Static or Dynamic mode, and use the button next to the code to copy the entire generated snippet.
- Insert the snippet before the closing
</body>tag on the website.
The generated snippet already contains the loader script address and the channel_id of the correct channel. You do not need to find or replace either value for a regular connection.
2. Decide Whether an Agent Should Reply
The widget itself is a communication channel for website visitors. Installing it on a website does not automatically start an agent.
If Automatic Replies Are Not Needed
No additional setup is required. Open the website, make sure the widget appears and opens, then send a message and check that the conversation appears in the Cabinet.
If Automatic AI Replies Are Needed
- Create an agent or open an existing one.
- Under Autostart, select On All Messages or By Keywords and Link. For keyword-based start, add the phrases that should trigger the agent.
- In Channels, select the Widget channel you created. If the rule is intentionally meant for every matching project channel, you can leave the channel restriction unset.
- On the Tools tab, enable Generate AI response. Forbid sending the response to the client must be disabled; otherwise, the response is saved in the conversation but is not sent to the visitor.
- Publish and activate the agent.
- Send a message through the widget that matches the selected autostart mode and check the response.
3. Verify the Basic Connection
Before adding context, markup, or actions, make sure that:
- the widget appears only on the expected pages and opens in the selected way;
- a message can be sent from an allowed domain;
- the new conversation appears in the Cabinet;
- when an agent is connected, it replies only when its configured autostart rule matches.
Once the basic scenario works, continue with How the Integration Works, then add only the features you need.
Terms Used in Examples
The value "xxx" in examples stands for the channel_id from the generated code of a particular channel. It is needed only when a developer assembles an extended configuration manually.
The external page that embeds the widget is called the site page, and the widget-loader.js file it loads is called the loader script.