Skip to main content

Installation & Setup

The CMND Embed Widget allows you to add a powerful AI chatbot to your website with minimal effort. No complex frameworks or React required—just add a script to your page and you're ready to go.

note

This guide walks you through the complete process from creating a chatbot on the CMND platform to embedding it on your website using simple HTML and JavaScript.

Step 1: Create a Chatbot on CMND.ai

Before adding the widget to your website, you'll need to create a chatbot on the CMND dashboard:

  1. Sign up or log in to your CMND account at cmnd.ai if you haven't already

  2. Navigate to the Chatbots section in the sidebar

    Chatbots sidebar

  3. Click "Create Chatbot" in the top-right corner

  4. Select "Embed Chatbot" from the options

    Embed Chatbot

  5. Configure your chatbot in the General tab (title, model type, output token length, cost limit, token limit, system prompt).

    You can start with the default settings and adjust later as needed

    Chatbot Configuration

  6. Click "Create Chatbot" to finalize

info

After creation, navigate to the Embed tab and copy your chatbotID and your organizationID. You'll need these identifiers for the next step.

Step 2: Add the Widget Script

Add the CMND widget script to your website by placing this code in the <head> section of your HTML:

HTML
<script src="https://embed.cmnd.ai/widget.js"></script>

This loads the necessary JavaScript to display and operate the chatbot widget.

Step 3: Initialize the Chatbot

Initialize the widget with your credentials using the window.cmndChat() method:

JavaScript
window.cmndChat("init", {
chatbot_id: "YOUR_CHATBOT_ID",
organization_id: "YOUR_ORG_ID",
});

Replace YOUR_CHATBOT_ID and YOUR_ORG_ID with the values copied from the CMND dashboard.

Implementation Examples

HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My Website with CMND Chat</title>

<!-- CMND Widget Script -->
<script src="https://embed.cmnd.ai/widget.js"></script>

<!-- Initialize when DOM is ready -->
<script>
document.addEventListener("DOMContentLoaded", function () {
window.cmndChat("init", {
chatbot_id: "YOUR_CHATBOT_ID",
organization_id: "YOUR_ORG_ID",
});
});
</script>
</head>
<body>
<!-- Your website content -->
</body>
</html>
Important

When initializing the widget from a script in the <head>, always wrap your code in a DOMContentLoaded event listener to ensure the page has loaded before the widget is initialized.

For additional support, contact our team at info@cmnd.ai.