Bridgetown Plugin
Add the Asyntai AI chat assistant to your Bridgetown site
Overview
Bridgetown is a Ruby static site generator. The Asyntai plugin is a Ruby gem. Add it to your site, build the site, and the chat bubble is on every page.
The assistant answers your visitors from your own content, in more than 80 languages, day and night.
Requirements
- Bridgetown 1.2 or later, including 2.x
- An Asyntai account. The Free plan is enough to try the widget
Installation
Follow these steps to add Asyntai to your Bridgetown 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 Gem
Run this command in your project folder:
bundle add bridgetown-ai-chatbot
Add the Plugin
Open config/initializers.rb and add the plugin with your widget ID:
Bridgetown.configure do |config|
init :"bridgetown-ai-chatbot", widget_id: "asyntai_1a2b3c4d5e6f"
end
You can also use the block form:
init :"bridgetown-ai-chatbot" do
widget_id "asyntai_1a2b3c4d5e6f"
end
Build the Site
Run bin/bridgetown deploy or bin/bridgetown build and publish. Open your site and the chat bubble is in the corner of every page.
Options
| Option | Type | Default | What it does |
|---|---|---|---|
widget_id | string | required | Your Asyntai widget ID |
enable_in_development | boolean | true | Set it to false to keep the widget off the site while BRIDGETOWN_ENV is development |
script_url | string | the Asyntai CDN | Advanced. Load the widget from another URL |
A missing or malformed widget_id stops the build with a message that says how to fix it.
How It Works
The plugin adds the Asyntai loader to every HTML page your site builds, just before </body>. That includes pages, posts, collections and pagination. The loader waits for the page's load event, so your own content always renders first.
It works with every template engine: ERB, Serbea and Liquid. Feeds, JSON and other non-HTML files stay as they are.
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: Set enable_in_development: false while you work on the site. The widget then shows up only on the production build.
Removing It
Delete the init line and build again. The chat bubble is gone.
Plans & Pricing
The gem is free. View pricing.
Need Help?
If you have any questions or run into issues, contact us at [email protected].