GitBook
The CrawlDesk Ask AI widget enhances your GitBook 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 GitBook documentation site using the script embed method, including configuring a CrawlDesk project and embedding the widget script.
Prerequisites:
- Active CrawlDesk account.
- GitBook space set up with Pro or Enterprise plan for custom integrations.
- 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 GitBook documentation site using the script embed method.
-
Access GitBook Space Settings
Log in to your GitBook account and navigate to your space.
Go to Settings > Integrations to explore available options. If a dedicated CrawlDesk plugin is available, install it; otherwise, proceed with custom script embedding via a code block. -
Add the Widget Script
In your GitBook editor, create a new page or section (e.g., a hidden footer page) for global scripts.
Use the Embed block to add the following script:<script
src="https://cdn.crawldesk.com/widget.iife.js"
onload="initAIWidget({
key: 'YOUR_CRAWLDESK_WIDGET_KEY'
})"
></script>Replace
YOUR_CRAWLDESK_WIDGET_KEY
with your actual CrawlDesk API key (e.g.,wk_live_******
).
For global inclusion, consider using GitBook's custom code integrations if available on your plan, or embed in the main layout via the editor. -
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.
GitBook does not directly support editing HTML, CSS, or JavaScript, but embeds and integrations allow for widget addition. You may need to trigger a rebuild or publish changes to ensure the widget takes effect. Follow security best practices when adding custom scripts to your documentation. For example, keep your widget key secure and avoid exposing sensitive information.