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

  1. Welcome message — configured in agent builder
  2. Suggested questions — clickable chips when configured
  3. RAG answers — responses include citations to docs and Q&A sources
  4. Rich cards — actions can return interactive status/button components
  5. Attachments (Hobby+) — users can upload PDF for in-session context
  6. 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

FeatureMinimum plan
Basic chatFree
Procedures / guardrailsHobby
AttachmentsHobby
Actions / APIStandard
Email / voice / SlackStandard
SDK identity verificationEnterprise

Custom chat UI

For fully custom interfaces, use the REST API v2 with SSE streaming.

Related