Script attributes

Configuring the CDN widget from the script tag.

Browser Embed key dev · https://api.dev.oprag.ai

The hosted script reads its configuration from data- attributes on its own <script> tag. These are the CDN equivalents of mountWidget options.

AttributeRequiredDescription
data-projectYesProject id whose documents answer the questions.
data-embed-keyYesembed_live_ or embed_test_. Never an sk_ key.
data-api-urlYesAPI base URL for your environment, e.g. https://api.dev.oprag.ai.
data-inlineNoRenders the panel inline instead of as a floating launcher. See inline & launcher.
data-primary-colorNoOverrides the project's theme colour.
data-positionNobottom-right or bottom-left.
data-theme-modeNoauto, light, or dark. auto follows the visitor.
data-display-nameNoOverrides the assistant name shown in the header.
data-welcome-messageNoOverrides the project's welcome message.
data-quick-promptsNoComma-separated starter questions.
data-share-slug / data-share-tokenNoRenders a shared conversation rather than a project chat.
HTML
<script
  src="https://cdn.oprag.ai/widget.js"
  data-project="proj_abc123"
  data-embed-key="embed_live_..."
  data-api-url="https://api.dev.oprag.ai"
  data-primary-color="#0F766E"
  data-position="bottom-left"
  data-theme-mode="auto"
></script>

Ready to ship?

Get started free