Docusaurus Integration
Add the Asyntai chat assistant to your Docusaurus documentation site with one plugin
概述
Docusaurus turns your Markdown files into a documentation website. The Asyntai plugin adds the chat assistant to every page it builds, so readers can ask a question instead of searching. You add one line to your configuration file and nothing else.
工作原理
The plugin adds one script tag after the body of every generated page. The tag is marked async, so your documentation renders first and the widget loads after it. Nothing else about your site changes.
要求
- 一个 Asyntai 账户。注册免费,免费套餐就足以试用该窗口。
- A Docusaurus site, version 2 or 3
- Node.js 18 or newer, which Docusaurus already needs
安装
Follow these steps to add Asyntai to your Docusaurus site:
安装插件
Run this command in the folder that holds your Docusaurus site.
npm install docusaurus-plugin-asyntai
复制你的窗口 ID
打开 Asyntai 后台的「安装」页面。窗口 ID 就是那里显示的代码中 data-asyntai-id 的值。
data-asyntai-id="asyntai_xxxxxxxxxxxx"
Add It to Your Configuration
Open docusaurus.config.js and add the plugin with your widget ID.
plugins: [
['docusaurus-plugin-asyntai', {widgetId: 'asyntai_xxxxxxxxxxxx'}],
],
Build Your Site
Run your usual build command and publish the site. The chat bubble is on every page.
npm run build
提示: 发布前,请在 Asyntai 后台添加你的文档、问答和说明,这样助手从第一位访客起就能答得准确。
Answering From Your Documentation
Asyntai reads your published pages. Add your site address in the dashboard, and the assistant answers from the same documentation the widget sits on. You can add extra documents and question and answer pairs as well.
选项
- widgetId sets which Asyntai account answers. It is required, and a wrong value stops the build with a clear message.
- enableInDevelopment set to false keeps the widget off the site while you run the local development server.
- scriptUrl loads the widget from another address. Most sites never need this.
如何移除
Delete the plugin entry from docusaurus.config.js and build the site again. The widget is gone.
隐私
The plugin sends no data on its own. Asyntai receives data only when a visitor opens the chat and writes a message, exactly as it would with a snippet pasted by hand. 隐私政策.
套餐与价格
插件是免费的,聊天窗口适用于所有 Asyntai 套餐,包括免费套餐。每个套餐包含每月消息数量,由网站窗口和你的所有集成共用。付费套餐会提高这一数量。 查看定价.
需要帮助?
如果您有任何问题或遇到困难,请通过 [email protected] 联系我们。