Skip to main content

Add AI to Mintlify

Integrate the kapa.ai chat widget into your Mintlify documentation to enable users to ask natural language questions about your product, significantly enhancing user experience by providing quick and accurate answers.

Prerequisites

Before adding the widget to your Mintlify site, you'll need to:

  1. Ensure you have a kapa.ai project set up with your knowledge sources added
  2. Follow the general installation instructions to enabled your domain and obtain your Website ID
  3. Have access to Mintlify's Pro plan, which includes Custom JS functionality

Installation

Create a new JavaScript file (e.g., kapa-widget.js) in your docs content directory with the following code:

const script = document.createElement("script");
script.src = "https://widget.kapa.ai/kapa-widget.bundle.js";
script.async = true;
script.setAttribute("data-website-id", "XXX-XXX-XXX");
script.setAttribute("data-project-name", "PROJECT_NAME");
script.setAttribute("data-project-color", "#HEX_COLOR_CODE");
script.setAttribute("data-project-logo", "https://LINK_TO_LOGO.com/logo.png");
document.head.appendChild(script);

The file will be automatically included in every page of your documentation.

Customization Options

To tailor the widget to your brand and specific needs, visit our Configuration page. There, you'll find detailed instructions on how to adjust colors, logos, and other widget properties.

note

Since Mintlify loads custom JavaScript files globally, please ensure you follow security best practices when adding custom scripts to your documentation.