Alquimia AI Widget
Last updated
Last updated
A lightweight, embeddable chat widget that allows you to integrate the Alquimia AI assistant into any website. The widget appears as a floating button that expands into a full chat interface when clicked.
The widget repository is available at . Note that the widget must be deployed to a server before it can be consumed by a parent application using the script tag integration.
This widget application provides:
A floating chat button
Expandable chat interface
Seamless integration with Alquimia AI's assistant
Responsive design for all devices
Customizable appearance
The widget implementation follows these key steps:
When you include the widget script via /api/widget
, it:
Creates an iframe element on your webpage
Positions it in the bottom-right corner
Loads the widget interface within the iframe for security and style isolation
The widget consists of two main states:
A floating button (minimized state)
A full chat interface (expanded state)
To add the widget to your website, include the following script tag:
The widget will automatically initialize and appear as a floating button in the bottom-right corner of your page.
To run the development server:
Docker
Docker Compose
The application uses a multi-stage build process for optimal production deployment:
Builder Stage: Compiles and builds the Next.js application
Runner Stage: Creates a lightweight production image
Create a .env
file with the required variables:
Build and start the container:
Run in detached mode:
Stop the container:
The service includes health checks that:
Monitor the application every 30 seconds
Timeout after 10 seconds
Allow 3 retries before marking unhealthy
The following directories are mounted as volumes:
./public:/app/public
: For static files
./.next:/app/.next
: For Next.js build output
/api/widget
: Serves the widget script that can be embedded in any website
Then open to view the widget demo page.