Widget embed
Embed DocsChat on your website using the JavaScript SDK, public chat URL, or iframe.
Script embed (recommended)
Add the launcher script to your site:
<script src="https://your-domain/embed/v1.js" defer></script>
<script>
window.addEventListener('DOMContentLoaded', function () {
DocsChat.init({
agent: 'support',
baseUrl: 'https://your-domain',
accentColor: '#18181b',
});
});
</script>
Local dev: http://localhost:3000/embed/v1.js
Identity verification (Enterprise / white-label)
Sign user identity with your workspace webhookSecret:
// Server-side: HMAC-SHA256 of JSON payload
DocsChat.init({
agent: 'support',
identity: { userId: '123', email: 'user@example.com' },
signature: '<hmac-hex>',
});
Invalid signatures are rejected on API v2 when x-docschat-identity and x-docschat-signature headers are sent.
Public URL
https://your-domain/chat/{agent-slug}
Example (local dev): http://localhost:3000/chat/support
Iframe embed
<iframe
src="https://your-domain/chat/support"
width="400"
height="600"
style="border:1px solid #e4e4e7;border-radius:8px"
title="Support chat"
></iframe>
End-user experience
- Welcome message — configured in agent builder
- Suggested questions — clickable chips when configured
- RAG answers — responses include citations to docs and Q&A sources
- Rich cards — actions can return interactive status/button components
- Attachments (Hobby+) — users can upload PDF for in-session context
- Handoff (Standard+) — escalate to helpdesk inbox with full transcript
White-label
When the workspace has the White-label add-on or Enterprise plan, the Powered by DocsChat badge is hidden on the widget.
Plan limits
| Feature | Minimum plan |
|---|---|
| Basic chat | Free |
| Procedures / guardrails | Hobby |
| Attachments | Hobby |
| Actions / API | Standard |
| Email / voice / Slack | Standard |
| SDK identity verification | Enterprise |
Custom chat UI
For fully custom interfaces, use the REST API v2 with SSE streaming.