Skip to main content
Add an AI-powered chat widget directly to your website for instant customer support. To deploy the widget for support agents without embedding code on a site, see Chrome Extension.

Capabilities

Setup

Step 1: Create a Widget Deployment

  1. Go to Deploy
  2. Click Create Deployment
  3. Select your agent
  4. Choose Website Widget as the trigger
  5. Configure appearance and behavior
  6. Click Create

Step 2: Get the Embed Code

After creating the deployment:
  1. Click on the deployment to open settings
  2. Go to the Widget tab
  3. Copy the embed code

Step 3: Add to Your Website

Add the embed code before the closing </body> tag:
Replace YOUR_DEPLOYMENT_ID with your actual deployment ID.

Customization

Appearance

Customize the widget to match your brand:

Behavior

Configure how the widget behaves:

Advanced Configuration

JavaScript API

Control the widget programmatically:

Passing Context

Pass contextual information to help the agent:

Proactive messages

Normally the visitor starts the conversation. With proactive messages your own page code starts it instead — the agent opens with a greeting before the visitor types anything. Use it to offer help on a pricing page, nudge a visitor who has stalled in checkout, or react to an in-app event. Call window.DuckieWidget.trigger(...) from your site:

Choosing who writes the opener

Options

trigger(options) accepts: trigger() returns a Promise that resolves with the result, including runId and status:

Triggering before the script loads

If you might call trigger() before embed.js has finished loading, push the call onto a queue instead — it runs as soon as the widget is ready:
Proactive triggers are rate-limited per visitor and use the same agent and origin rules as normal widget chat. A trigger from an origin without an active widget deployment, or for an inactive agent, is rejected.

Best Practices

Strategic Placement

  • Show on pages where users need help (pricing, checkout, docs)
  • Consider hiding on landing pages to reduce distraction
  • Use page-specific welcome messages

Provide Context

Pass user and page context so the agent can personalize responses:
  • User’s plan or tier
  • Current page or product
  • Account information

Set Expectations

Use the welcome message to set expectations:
  • “Hi! I’m an AI assistant. How can I help?”
  • Mention response times for complex issues

Example Implementations

Documentation Site

SaaS Dashboard

Troubleshooting

Widget not appearing

  • Check browser console for JavaScript errors
  • Verify the deployment ID is correct
  • Ensure the script is loading (check Network tab)

Slow to load

  • The widget script is loaded asynchronously
  • Initial load may take 1-2 seconds
  • Subsequent loads are cached

Styling conflicts

  • Widget uses Shadow DOM to isolate styles
  • If issues persist, check for global CSS resets