Web Chat Widget
The Web Chat Widget allows you to embed Crew’s AI chat agents directly on your website. Visitors can interact with your agent without leaving your site.Quick Start
Add the widget to your website with a single script:Installation Methods
Script Tag (Recommended)
Add to your HTML before</body>:
React Component
Vue Component
Configuration
Basic Options
| Option | Type | Default | Description |
|---|---|---|---|
crewId | string | required | Your Crew ID |
agentId | string | required | Chat agent ID |
position | string | bottom-right | Widget position |
primaryColor | string | #6366F1 | Theme color |
title | string | Chat with us | Header title |
subtitle | string | null | Header subtitle |
greeting | string | auto | Initial message |
Positioning
Theming
Custom Launcher
Replace the default launcher button:User Identification
Anonymous Users
By default, users are tracked anonymously with a session ID:Identified Users
Pass user information for personalized experiences:Dynamic Identification
Update user info after page load:JavaScript API
Open/Close Widget
Send Messages
Events
Unread Count
Pre-Chat Form
Collect information before starting the conversation:Rich Messages
The widget supports rich message types:Quick Replies
Cards
Carousels
Human Handoff
Transfer chat to a human agent:Webhook Handoff
Offline Mode
Configure behavior when outside business hours:Security
Content Security Policy
If using CSP, add:Domain Allowlisting
Restrict which domains can use your widget:Analytics
Track widget usage:widget_openedwidget_closedmessage_sentmessage_receivedconversation_startedhandoff_triggered
Best Practices
Load asynchronously
Load asynchronously
Always use
async to prevent blocking page load.Match your brand
Match your brand
Customize colors and styling to match your website.
Set expectations
Set expectations
Use the greeting to explain what the AI can help with.
Provide human fallback
Provide human fallback
Always offer a way to reach a human for complex issues.
Test on mobile
Test on mobile
Verify the widget works well on mobile devices.
Next Steps
- Agents Overview — Configure chat agents
- Pathways — Design chat conversation flows
- Webhooks — Receive chat events