Script attributes
Configuring the CDN widget from the script tag.
The hosted script reads its configuration from data- attributes on its own <script> tag. These are the CDN equivalents of mountWidget options.
| Attribute | Required | Description |
|---|---|---|
data-project | Yes | Project id whose documents answer the questions. |
data-embed-key | Yes | embed_live_ or embed_test_. Never an sk_ key. |
data-api-url | Yes | API base URL for your environment, e.g. https://api.dev.oprag.ai. |
data-inline | No | Renders the panel inline instead of as a floating launcher. See inline & launcher. |
data-primary-color | No | Overrides the project's theme colour. |
data-position | No | bottom-right or bottom-left. |
data-theme-mode | No | auto, light, or dark. auto follows the visitor. |
data-display-name | No | Overrides the assistant name shown in the header. |
data-welcome-message | No | Overrides the project's welcome message. |
data-quick-prompts | No | Comma-separated starter questions. |
data-share-slug / data-share-token | No | Renders a shared conversation rather than a project chat. |
<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