astro-ai-chatbot
Add the Asyntai AI chat assistant to your Astro site. It
answers visitor questions from your own content, in more than 80 languages.
Install
npx astro add astro-ai-chatbot
Or install it by hand:
npm install astro-ai-chatbot
Then add the integration in astro.config.mjs:
import { defineConfig } from 'astro/config';
import asyntai from 'astro-ai-chatbot';
export default defineConfig({
integrations: [asyntai({ widgetId: 'asyntai_1a2b3c4d5e6f' })],
});
Build the site. The chat bubble is on every page.
Where the widget ID comes from
Open the Install page in your Asyntai dashboard.
The widget ID is the value of data-asyntai-id in the snippet shown there. It
starts with asyntai_.
Creating an account is free, and the Free plan is enough to try the widget.
Options
widgetId | string | required | Your Asyntai widget ID |
enableInDevelopment | boolean | true | Set to false to keep the widget off the site during astro dev |
scriptUrl | string | the Asyntai CDN | Advanced. Load the widget from another URL |
A missing or malformed widgetId stops the build with a message that says how
to fix it.
What the integration does
- It adds the Asyntai loader to every page of the site.
- The loader waits for the page's
load event, so your own content always
renders first.
- It works with every Astro output mode: static, server and hybrid.
Answering from your content
Asyntai reads your published pages. Add your site URL in the dashboard, and the
assistant answers from the same pages the widget sits on. You can also add extra
documents and question and answer pairs.
TypeScript
Types ship with the package. astro.config.ts works with no extra setup.
Removing it
Delete the integration from astro.config.mjs and build again. The widget is
gone.
Support
Email hello@asyntai.com, or read the
Astro guide.
Licence
MIT. See LICENSE.