Embedding your Aimdoc agent

For your users to interact with your agent, Aimdoc provides widgets you can plug into site by pasting a simple embed code.

Presentation modes

You can choose how your agent is displayed on your site (Chatbot, Copilot, or Sidebar) from the Appearance tab. See Appearance for details.

Preview Widget in Dashboard

You can preview the widget directly in the Aimdoc dashboard. Navigate to an Agent, drill into the Agent Builder and click the "Preview" tab on the far right. Your widget will be displayed in the bottom right corner of the dashboard for you to test.


Promote your agent

Preview Widget on your site

Toggle the widget to site preview mode by toggling the switch to "Website". Submit the url of your site and click "Preview". It will open in a new tab and you can test the widget on your site before deploying.


Promote your agent
Promote your agent

Admin Mode for Task Recording (Activate)

If you use App Mode to record Task Definitions, you can enable task recording by appending ?aimdocAdmin=true to your application URL. This opens your app with the task recorder enabled in the widget so you can capture clicks, inputs, and voice narration. Use the Record Tasks button in the Agent Builder's App Mode tab—it opens your app with this parameter automatically.

For end users, the widget behaves normally. Admin mode is only for recording tasks.

Deploy Widget on your site

Copy and paste the embed code into your site and then publish or deploy. Aimdoc provides scripts for popular frameworks like React and Next.js. For website builders like Wix, Framer, Webflow and Squarespace, you can use the simple embed code for static sites. This should be placed wherever you can paste custom HTML into the <body> tag of your site.


Promote your agent

Here's an example using Aimdoc's embed code. Simply replace the agentId with the id of your agent.

<script>
(function() {
    function initAgent() {
        window.Agent.initAgentChat('ai-assistant', {
            agentId: '404ff453-4709-489a-ac3f-965db57a64d0'
        });
    }
    var script = document.createElement('script');
    script.src = 'https://app.aimdoc.ai/embedded.bundle.js';
    script.async = true;
    script.onload = initAgent;
    document.body.appendChild(script);
})();
</script>

Promote your agent

Was this page helpful?