🚀 Astroid Chat Widget - Integration Guide
Welcome! Here's how to add the Astroid chat widget to your website.
📋 Step 1: Add the Script
Copy and paste this code before the closing </body> tag of your website:
<script>
window.AstroidChatConfig = {
tenantId: "YOUR_TENANT_ID",
apiUrl: "https://api.astroid.io",
companyName: "Your Company",
primaryColor: "#2563eb",
position: "right"
};
</script>
<script src="https://cdn.astroid.io/widget/asteroid-widget.iife.js"></script>
⚙️ Configuration Options
| Option |
Type |
Required |
Description |
tenantId |
string |
✅ Yes |
Your unique company identifier (provided by Astroid) |
apiUrl |
string |
No |
Custom API endpoint URL |
companyName |
string |
No |
Name displayed in chat header |
primaryColor |
string |
No |
Hex color for branding (e.g., "#ff5500") |
position |
string |
No |
"left" or "right" - widget position |
🎮 JavaScript API
You can also control the widget programmatically:
window.AstroidChat.open();
window.AstroidChat.close();
window.AstroidChat.init({
tenantId: "abc123",
companyName: "My Company"
});
✅ Complete Example
<html>
<head>
<title>My Website</title>
</head>
<body>
<h1>Welcome to My Website</h1>
<p>Your content here...</p>
<script>
window.AstroidChatConfig = {
tenantId: "company_abc123",
companyName: "ABC Corp Support",
primaryColor: "#10b981"
};
</script>
<script src="https://cdn.astroid.io/widget/asteroid-widget.iife.js"></script>
</body>
</html>