browser-automation middleware, the agent can inspect the current page, click, fill forms, scroll, navigate, and fall back to screenshots plus viewport coordinates for complex pages.
The usual setup is: create and publish a digital expert from the “Client browser automation tools” template in XpertAI, then configure the Chrome extension with the expert’s xpertId, Xpert API URL, ChatKit frame URL, and credential.
Important resources
- ChatKit JavaScript repository
- ChatKit browser extension releases
- XpertAI platform
- XpertAI API integration guide
- Browser Automation Middleware
How it works
The extension provides two surfaces:
- Chrome side panel: useful for ongoing conversations and tasks across pages.
- Page overlay: injected on demand into the active HTTP(S) tab, either as a Pet launcher or as a full chat panel.
Prerequisites
Before you start, make sure you have:- Access to XpertAI with permission to create and publish digital experts.
- The ChatKit Chrome extension package, or source access so you can build it.
- An XpertAI AI API URL.
- Public cloud default:
https://api.xpertai.cn/api/ai - For private deployments, use your own API URL.
- Public cloud default:
- A ChatKit frame URL.
- Public cloud default:
https://app.xpertai.cn/chatkit - For private deployments, use your own ChatKit frontend URL.
- Public cloud default:
- A normal HTTP(S) target page. Chrome internal pages such as
chrome://, the Chrome Web Store, extension pages, and other restricted pages cannot host the overlay and cannot be operated by normal host page automation.
Step 1: Create the digital expert from the template
- Sign in to XpertAI.
- Open the template or explore page and search for “Client browser automation tools”.
- Create a digital expert from that template.
- Open the agent orchestration view and confirm that the workflow includes the
Browser Automationmiddleware. - If the agent should be allowed to navigate the current page, keep
Allow Navigationenabled. This exposes thehost_page_navigatetool. - Adjust the main agent prompt if needed. The default template prompt instructs the agent to help the user operate the browser and to switch to screenshot plus coordinate actions after repeated action failures.
- Publish the digital expert.
- Copy the published expert’s
xpertId. - Create an access key from the digital expert development interface or workspace API Keys page. See Development SDK for API key details.
xpert--client-browser-automation-tools. Its key node is a middleware whose provider is browser-automation; the template enables allowNavigation: true by default.
Step 2: Install the Chrome extension
If you have a ChatKit browser extension release package, unzip it and load the extension directory in Chrome. If you build from source, use the xpert-ai/chatkit-js repository:chrome://extensions:
- Enable Developer mode.
- Click Load unpacked.
- Select the
dist/chromedirectory. - Pin the Xpert ChatKit extension icon to the toolbar.
storage, sidePanel, scripting, activeTab, and debugger.
Step 3: Configure the extension
Click the extension icon, open Options, and fill in these fields:
After saving, the extension popup shows whether the configuration is complete. If
frameUrl, apiUrl, or the credential is missing, ChatKit shows a configuration prompt.
Step 4: Use it
- Open a normal HTTP(S) page.
- Click the Xpert ChatKit extension icon.
- Choose Open side panel, or click Toggle page overlay to open the overlay on the current page.
- Ask ChatKit to perform a task, for example:
Automation capabilities
Thebrowser-automation middleware exposes these client tools to the model:
The backend also provides a server-side
host_page_wait tool for waiting 3 to 60 seconds while pages render, animate, navigate, or settle after async work.
Recommended action flow:
- Start with
host_page_snapshotto understand the page and identify targets. - Prefer
host_page_fill,host_page_press, andhost_page_selectfor clear form fields. - If one click does not change the page, do not repeat the same click. Use
host_page_wait_for,host_page_screenshot, orhost_page_pointerinstead. - Screenshot coordinates are viewport CSS pixels. They are not OS screen coordinates and do not include browser chrome or the ChatKit side panel.
Troubleshooting
ChatKit asks me to configure it
Check thatChatKit frame URL, Xpert API URL, and Client Secret / API Key are filled in the extension Options page. Also confirm that the configured xpertId belongs to a published digital expert.
The page overlay does not open
The overlay can only be injected into HTTP(S) pages. Avoidchrome://, the Chrome Web Store, PDF viewer pages, extension pages, browser settings pages, and other restricted surfaces.
The agent cannot click or fill the page
Confirm thatAllow agents to operate the host page is enabled in Options. If Chrome asks for debugger permission, allow the extension to connect to the current tab. For complex pages, ask the agent to take a screenshot and then use host_page_pointer with viewport coordinates instead of repeating DOM clicks.
A private or local ChatKit frame is blocked by Chrome
Make sure the service behindframeUrl allows extension pages to embed it. Do not return X-Frame-Options headers that block embedding, and check whether Content-Security-Policy: frame-ancestors allows extension usage.
Auto launch Pet does not work
Make sure all required conditions are true:Enable page overlay is enabled, Auto launch page pet is enabled, Launch mode is Pet launcher, the tab is an HTTP(S) page, and the base configuration validates successfully.