Prerequisites
Before you begin, you’ll need:- A Dial AI chat ID (see Creating a Chat ID below)
- The backend URL for your Dial AI instance
- A unique anchor ID for mounting the chat button
Creating a Chat ID
To generate a chat ID for your integration:- Navigate to the Flows section in your Dial AI dashboard
- Locate the flow you want to use for the chat
- Click the “Share” button in the top-right corner
- Click “Generate” to create a new chat ID
- Copy the generated chat ID to use in your integration

Basic Integration
Add the following code to your HTML file, replacing the placeholder values as needed:Configuration Options
TherenderModal function accepts the following configuration options:
- iconUrl(string, required): URL to the icon that will be displayed in the chat button
- chatId(string, required): Your unique Dial AI chat identifier
- backendUrl(string, required): The base URL of your Dial AI instance
- brandVariants(object, optional): Custom color scheme for the chat interface
CORS Configuration
For the script to work properly, ensure that your domain is whitelisted in the CORS configuration of your Dial AI instance. Contact your Dial AI administrator to add your development and production domains to the allowed origins list.Customization
You can customize the appearance of the chat interface by modifying thebrandVariants object. The color values follow a scale from 10 (darkest) to 160 (lightest), allowing for consistent theming throughout the interface.
Troubleshooting
- If the chat button doesn’t appear, check your browser’s console for any error messages
- Ensure the anchor element with the specified ID exists in the DOM when the script runs
- Verify that your domain is properly whitelisted in the CORS configuration
- Make sure the chat ID and backend URL are correct