Embedding Your Agent
Deploy your AI agent to websites, apps, and messaging platforms with multiple integration options
Embedding Your Agent#
Deploy your trained AI agent to your website, app, or messaging platforms. AlonChat provides multiple integration options to reach your customers wherever they are.
Embedding Options#
| Option | Description | Best For |
|---|---|---|
| Website Chat Widget | Floating chat bubble on your website | Most websites |
| Inline Frame (iframe) | Embedded chat window within your page layout | Support pages, dashboards |
| Facebook Messenger | Auto-respond to Facebook page messages and comments | Facebook business pages |
| Auto-respond to Instagram DMs and comments | Instagram business accounts | |
| Auto-respond to WhatsApp messages | WhatsApp Business users | |
| Telegram | Auto-respond in Telegram groups | Telegram communities |
| Auto-respond to emails | Email support | |
| API Integration | Build custom integrations via REST API | Custom apps and workflows |
Website Chat Widget#
Overview#
The chat widget appears as a floating bubble in the bottom corner of your website. Clicking it opens a chat window where visitors can talk to your AI agent.
Features:
- Customizable colors and branding
- Mobile-responsive
- Dark mode support
- Conversation history
- Lead capture form
Quick Embed#
Add this code before the closing </body> tag on your website:
<script src="https://cdn.alonchat.com/widget.js"
data-agent-id="YOUR_AGENT_ID"
data-color="#006ED9">
</script>
Replace YOUR_AGENT_ID with your agent ID from the Settings page.
Customization#
Configure the widget using data attributes on the script tag:
| Attribute | Description | Default |
|---|---|---|
data-agent-id | Your agent ID (required) | -- |
data-color | Widget accent color (hex) | #006ED9 |
data-position | bottom-right or bottom-left | bottom-right |
For more options (greeting text, auto-open, suggested messages, lead forms, domain restrictions), use the dashboard at Settings > Widget.
Platform Guides#
WordPress#
- Go to Appearance > Theme Editor
- Select footer.php (or use a plugin like "Insert Headers and Footers")
- Paste the script tag before
</body> - Save changes
Shopify#
- Go to Online Store > Themes > Actions > Edit Code
- Open Layout > theme.liquid
- Paste the script tag before
</body> - Save
Wix#
- Go to Settings > Custom Code
- Click + Add Custom Code
- Paste the script tag
- Select "Body - end" placement and apply to all pages
- Publish site
Any HTML Website#
<!DOCTYPE html>
<html>
<head>
<title>Your Website</title>
</head>
<body>
<!-- Your website content -->
<!-- AlonChat Widget -->
<script src="https://cdn.alonchat.com/widget.js"
data-agent-id="YOUR_AGENT_ID"
data-color="#006ED9">
</script>
</body>
</html>
Inline Frame (iframe)#
Overview#
Embed the chat directly into your page layout instead of as a floating widget. This is useful for dedicated support pages, dashboard sidebars, or product Q&A sections.
Installation#
Step 1: Get iframe URL
https://alonchat.com/embed/YOUR-AGENT-ID
Step 2: Add iframe to your page
<iframe
src="https://alonchat.com/embed/YOUR-AGENT-ID"
width="100%"
height="600"
frameborder="0"
allow="clipboard-write"
title="AlonChat Support">
</iframe>
Responsive design:
<div style="position: relative; width: 100%; padding-bottom: 75%; height: 0;">
<iframe
src="https://alonchat.com/embed/YOUR-AGENT-ID"
style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;"
allow="clipboard-write"
title="AlonChat Support">
</iframe>
</div>
Customization via URL parameters:
https://alonchat.com/embed/YOUR-AGENT-ID?
primaryColor=006ED9&
hideHeader=true&
autoFocus=true
API Integration#
Overview#
Build custom integrations using AlonChat's REST API at https://api.alonchat.com/v1/.
Use cases:
- Custom chat UI in your app
- Integrate with existing CRM
- Build multi-channel support system
- Create Slack/Discord bots
Quick Start#
Step 1: Get API key
- Go to Settings > API
- Click Generate API Key
- Copy and store securely
Step 2: Send chat message
curl -X POST https://api.alonchat.com/v1/agents/{agentId}/chat \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": "How much does shipping cost?",
"conversationId": "optional-conversation-id",
"userId": "user-123"
}'
Response:
{
"response": "Shipping costs vary by location. Metro Manila delivery is free for orders over $50.",
"conversationId": "conv-abc123",
"sources": [
{
"title": "Shipping Policy",
"content": "..."
}
]
}
Best Practices#
1. Placement#
Website widget:
- Bottom-right is most familiar and has high visibility
- Bottom-left is a good alternative if something else occupies the right corner
- Avoid top corners -- visitors do not expect chat widgets there
iframe:
- Minimum height of 500px for usability
- Use responsive wrapper for mobile
- Works well on dedicated support or FAQ pages
2. Customization#
- Match your brand colors using
data-color - Write a welcome message that matches your tone of voice
- Test on mobile devices (real devices, not just browser emulators)
3. User Experience#
- Only auto-open on support pages, not the homepage
- Provide suggested messages to help visitors start a conversation
- Set up human handoff for questions the AI cannot answer
4. Performance#
- The widget script is loaded from a CDN and is optimized for fast loading
- Place the script tag before
</body>so it does not block page rendering
5. Privacy#
- Add to your privacy policy: "We use an AI chatbot to respond to inquiries"
- Enable lead capture forms with clear data use explanations
- Inform visitors they are chatting with an AI agent
Next Steps#
- Widget Setup Guide -- Detailed widget configuration
- Help Page -- Create a standalone help center
- Lead Capture -- Collect visitor information
- Integrations Overview -- All platform integrations
- API Reference -- Build custom integrations