Skip to content

Widget Attributes

All configuration is done via data-* attributes on the <script> tag. No JavaScript API calls are needed.

Attribute Reference

AttributeTypeRequiredDefaultDescription
data-serverstringNohttps://widget.webnav.aiDocQA backend server URL
data-base-urlstringYesThe website URL to crawl and index
data-themestringNolightColor theme: light or dark
data-langstringNoAuto-detectedUI language: zh, en, zht, ja
data-logostringNoDocQA logoURL of a custom logo for the widget header
data-modestringNobubbleWidget display mode
data-excludestringNoComma-separated routes to exclude from crawling

Examples

Minimal

html
<script
  src="https://widget.webnav.ai/widget/chat-widget.js"
  data-base-url="https://yoursite.com"
></script>

Dark Theme with English UI

html
<script
  src="https://widget.webnav.ai/widget/chat-widget.js"
  data-base-url="https://yoursite.com"
  data-theme="dark"
  data-lang="en"
></script>

Exclude Admin Routes

html
<script
  src="https://widget.webnav.ai/widget/chat-widget.js"
  data-base-url="https://yoursite.com"
  data-exclude="/admin,/login,/dashboard"
></script>
html
<script
  src="https://widget.webnav.ai/widget/chat-widget.js"
  data-base-url="https://yoursite.com"
  data-logo="https://yoursite.com/logo.png"
></script>

DocQA — AI 智能客服