Mintlify
The CrawlDesk Ask AI widget enhances your Mintlify documentation by adding an interactive AI-powered assistant that allows users to ask natural language questions directly within your site. The widget is integrated via a lightweight script embed, hosted at Crawldesk CDN.
This guide details how to deploy the Ask AI widget in a Mintlify documentation site using the script embed method, including configuring a CrawlDesk project and embedding the widget script.
Prerequisites:
- Active CrawlDesk account
- Mintlify documentation site set up with the Pro plan, which includes Custom JS functionality.
- CrawlDesk widget API key (obtained from the CrawlDesk dashboard).
Deploying the Ask AI Widget
Follow these steps to deploy the CrawlDesk Ask AI widget in your Mintlify documentation site using the script embed method.
-
Add the Script to Your Mintlify Site
Create a new JavaScript file (e.g.,crawldesk-widget.js
) in your Mintlify docs content directory. Add the CrawlDesk widget script:const script = document.createElement("script");
script.src = "https://cdn.crawldesk.com/widget.iife.js";
script.async = true;
script.onload = () => {
window.initAIWidget({
key: "YOUR_CRAWLDESK_WIDGET_KEY",
});
};
document.head.appendChild(script);Replace
YOUR_CRAWLDESK_WIDGET_KEY
with your actual CrawlDesk API key (e.g.,wk_live_**********
). The file will be automatically included in every page of your documentation. -
Secure the API Key
Since Mintlify loads custom JavaScript files globally, avoid exposing sensitive information in the script. Manage the API key securely in your CrawlDesk dashboard and follow Mintlify’s security best practices for handling custom scripts to ensure the key remains protected. -
Customize the Widget
Visit your CrawlDesk dashboard to tailor the widget to your brand. You can adjust settings such as colors, logos, and other styling options to create a seamless, branded experience for your users.
Since Mintlify loads custom JavaScript files globally, please ensure you follow security best practices when adding custom scripts to your documentation. For example, keep your widget key secure and avoid exposing sensitive information.