TypeDoc Plugin
Add the Asyntai AI chat assistant to your TypeDoc API documentation
Overview
TypeDoc builds API documentation websites from TypeScript code. The Asyntai plugin is an npm package. Add it to your TypeDoc configuration, build the docs, and the chat bubble is on every page.
The assistant answers developers from your own documentation, in more than 80 languages, day and night.
Requirements
- TypeDoc 0.26, 0.27 or 0.28
- Node 18 or later
- An Asyntai account. The Free plan is enough to try the widget
Installation
Follow these steps to add Asyntai to your TypeDoc site:
Get Your Widget ID
Sign in to Asyntai and open the Install page. The widget ID is the value of data-asyntai-id in the snippet shown there. It starts with asyntai_.
Add the Package
Run this command in your project folder:
npm install --save-dev typedoc-plugin-ai-chatbot
Add the Plugin
Open typedoc.json and add the plugin with your widget ID:
{
"entryPoints": ["src/index.ts"],
"plugin": ["typedoc-plugin-ai-chatbot"],
"asyntaiWidgetId": "asyntai_1a2b3c4d5e6f"
}
You can also give the ID on the command line:
npx typedoc --plugin typedoc-plugin-ai-chatbot --asyntaiWidgetId asyntai_1a2b3c4d5e6f
Build the Docs
Run npx typedoc and publish the output folder. Open your docs and the chat bubble is in the corner of every page.
Options
| Option | Type | Default | What it does |
|---|---|---|---|
asyntaiWidgetId | string | required | Your Asyntai widget ID |
asyntaiScriptUrl | string | the Asyntai CDN | Advanced. Load the widget from another URL |
A missing or malformed asyntaiWidgetId stops the build with a message that says how to fix it. Both options also show in npx typedoc --help, and TypeScript checks them in a typedoc.config file.
How It Works
The plugin adds the Asyntai loader to every HTML page TypeDoc builds, just before </body>. The loader waits for the page's load event, so your documentation always renders first. TypeDoc's own search and navigation stay as they are.
It works with the default theme and with every theme that extends it.
Answering From Your Documentation
Asyntai reads your published pages. Add your docs URL in the dashboard, and the assistant answers from the same pages the widget sits on. You can also add guides, and question and answer pairs.
Tip: Add your README, changelog and getting started guide in the dashboard too. Developers then get answers about setup as well as about the API.
Removing It
Delete the plugin from the plugin list and build again. The chat bubble is gone.
Plans & Pricing
The package is free. View pricing.
Need Help?
If you have any questions or run into issues, contact us at [email protected].