ApostropheCMS Module
Add the Asyntai AI chat assistant to your ApostropheCMS site
Overview
ApostropheCMS is an open source content management system built on Node.js. The Asyntai module is an npm package. Enable it in app.js, restart the site, and the chat bubble is on every page. Your templates stay as they are.
The assistant answers your visitors from your own content, in more than 80 languages, day and night, and collects leads when a visitor wants to be contacted.
Requirements
- ApostropheCMS 3 or 4
- 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 ApostropheCMS 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 apostrophecms-ai-chatbot
Enable the Module
Open app.js and add the module to the modules list with your widget ID:
require('apostrophe')({
shortName: 'my-site',
modules: {
// ...your other modules
'apostrophecms-ai-chatbot': {
options: {
widgetId: 'asyntai_1a2b3c4d5e6f'
}
}
}
});
You can also leave widgetId out and set the ASYNTAI_WIDGET_ID environment variable on your server.
Restart the Site
Restart Apostrophe. Open your site and the chat bubble is in the corner of every page.
Options
| Option | Type | Default | What it does |
|---|---|---|---|
widgetId | string | ASYNTAI_WIDGET_ID environment variable | Your Asyntai widget ID |
enabled | boolean | true | Set it to false to turn the widget off, for example on a staging server |
scriptUrl | string | the Asyntai CDN | Advanced. Load the widget from another URL |
A missing or malformed widget ID does not stop your site. Apostrophe logs a warning that says how to fix it, and the pages are served without the widget.
How It Works
The module adds a small loader script at the end of <body> on every page, next to Apostrophe's own scripts. The loader waits for the page's load event, so your own content always renders first.
API responses and in-context editing refreshes get no script, and a page that already has the Asyntai snippet does not get a second one.
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 documents, and question and answer pairs.
Tip: Keep the widget ID in the ASYNTAI_WIDGET_ID environment variable and set enabled: false on your staging server. Only your live site then shows the chat bubble.
Removing It
Delete the apostrophecms-ai-chatbot entry from app.js, uninstall the package and restart the site. The chat bubble is gone.
Plans & Pricing
The module is free. View pricing.
Need Help?
If you have any questions or run into issues, contact us at [email protected].