External Widget
Deployment Guide
Step-by-step instructions for customizing the widget appearance, generating secure deployment tokens, and embedding the chatbot using all four deployment methods.
Open Widget Deployment Settings
- Log in as an Admin.
- Navigate to Deployment from the main dashboard menu.
- Select the tenant you want to deploy from the dropdown list.
Customize the Widget Appearance
Once a tenant is selected, the Widget Settings panel appears. Configure the visual appearance of the chat widget here.
| Setting | Description | Default |
|---|---|---|
| Widget Enabled | Turn the widget on or off globally for this tenant without deleting any tokens | Enabled |
| Company Logo | Upload a PNG, JPG, GIF, or SVG up to 2 MB — displayed in the widget header | None |
| Widget Position | Where the floating button appears: Bottom Right, Bottom Left, Top Right, or Top Left | Bottom Right |
| Button Color | Background color of the floating chat button — accepts hex codes | #3B82F6 |
| Header Color | Background color of the chat window header bar | #3B82F6 |
| Widget Title | Heading text shown in the chat window header (e.g., "Acme Support") | Chat with us |
| Widget Subtitle | Short line of text below the title (e.g., "We typically reply in minutes") | None |
| Welcome Message | First message shown when a visitor opens the chat window, before typing anything | None |
| Input Placeholder | Hint text shown inside the message input field before the user types | Type your message... |
| Show Branding | When enabled, a "Powered by" attribution line appears at the widget bottom | Enabled |
Click "Save Settings" when done. A confirmation notification will appear.
Create a Deployment Token
Tokens are the security keys that authorize your widget to connect to the chatbot service. You need at least one token before deploying.
- Click "Add New Token" in the tokens section.
- Enter a Token Name — a human-readable label identifying where this token is used (e.g., "Production Website", "Staging Site").
- Optionally enter Allowed Domains to restrict the token to specific websites. Leave empty for testing environments.
- Click "Create" to generate the token.
wgt_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. Treat this like a password — do not share it publicly.
Token Name
Use descriptive labels per environment: Production Website, Staging Site, Landing Page — Campaign Q4
Allowed Domains
Example: acmecorp.com, www.acmecorp.com — prevents unauthorized sites from using your token.
Choose Your Deployment Method
Once a token is created, four deployment methods are available. Choose the one that fits your use case.
Best for: Adding a floating chat button to any existing website. A small JavaScript snippet loads the widget automatically.
Installation
- Copy the code snippet shown for your token from the Deployment page.
- Paste it into your website's HTML — either in the
<head>section or just before the closing</body>tag. - The widget will appear automatically on page load.
<!-- Add this script to your website -->
<script>
(function() {
var script = document.createElement('script');
script.src = 'https://yourdomain.com/widget.js';
script.setAttribute('data-token', 'wgt_your_token_here');
script.async = true;
document.head.appendChild(script);
})();
</script>
https://yourdomain.com/widget.js with the actual URL of your deployed Edge Chat platform.Best for: Sharing a direct link to a full-page chat experience via email, QR code, or a "Chat with us" button that opens a new tab.
How to Use It
- Share the URL directly with customers via email or messaging
- Link to it from a button on your website (opens in a new tab)
- Encode it in a QR code for physical marketing materials
Best for: Embedding the chat interface directly inside a page layout, such as a dedicated "Contact Us" or "Support" page.
<iframe src="https://yourdomain.com/widget?token=wgt_your_token_here" width="100%" height="600" frameborder="0" style="border: 1px solid #e5e7eb; border-radius: 8px;" ></iframe>
Customization Tips
- Adjust
heightto fit your layout:500,700, or100vh - Set
widthto a fixed pixel value or100%for responsive layouts - Remove the
borderandborder-radiusstyle attributes to match your own site's design
Best for: Developers building a fully custom chat interface using their own frontend code.
const response = await fetch(
'https://your-project.supabase.co/functions/v1/intelligent-chat',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-widget-token': 'wgt_your_token_here'
},
body: JSON.stringify({
message: 'Hello!',
sessionId: null // pass a previous sessionId to continue a conversation
})
}
);
const data = await response.json();
console.log(data.message); // the AI's response text
console.log(data.sessionId); // save this to maintain conversation continuity
Key Details
- The endpoint is your Supabase project's Edge Function URL
- Always pass
x-widget-tokenin the request header - Store the
sessionIdfrom each response and pass it back to maintain conversation history - A
sessionIdofnullstarts a new conversation
Managing Tokens
Each token appears in a list with its status, usage statistics, and management actions.
| Field | Description |
|---|---|
| Name | The label you gave the token (e.g., "Production Website") |
| Token Value | The full wgt_... token string in monospace font |
| Status | Active or Disabled |
| Allowed Domains | Displayed if domain restrictions are set on the token |
| Usage Count | How many times this token has been used to initiate a chat |
| Last Used | The date the token was last used, or "Never" |
Disabling a Token
Click "Disable" to immediately revoke access. Any widget using this token stops working. The token record is preserved — re-enable at any time.
Re-enabling a Token
Click "Enable" next to a disabled token to restore access immediately.
Best Practices
- Create one token per deployment environment (separate tokens for production and staging)
- Set domain restrictions on production tokens to prevent unauthorized use
- Disable rather than delete tokens when taking a deployment offline — preserves usage history
- For multiple websites on the same client, create a separate token per site for independent tracking
Troubleshooting
- Confirm the script tag is correctly pasted in your site's HTML
- Check that the
widget.jsURL points to your actual deployed platform domain - Verify the token is Active in the token list
- If domain restrictions are set, confirm the website's domain matches exactly
- The token may be disabled — check the token status in Deployment
- The tenant may be set to Inactive — check the tenant settings
- If domain restrictions are set, confirm the requesting domain is in the allowed list
- Review the tenant's System Context and Response Guidelines in Tenant Management
- Ensure the knowledge base has relevant documents uploaded
- Try adjusting the AI model or response temperature in the tenant settings
- Create a separate token for each website — this lets you track usage per site and disable individual deployments independently without affecting the others