Skip to content

Embed Widget Reference

The Quipthread embed widget is a self-contained JavaScript bundle. It reads configuration from data-* attributes on a <div id="comments"> container element.

<div
id="comments"
data-site-id="YOUR_SITE_ID"
data-page-id="YOUR_PAGE_ID"
></div>
<script
src="https://your-quipthread-instance.com/embed.js"
async
></script>

The script discovers your Quipthread instance automatically from the src URL — no separate API URL configuration needed.

The widget mounts into a <div id="comments">. The element must exist in the DOM before the script runs, or the script will exit silently. All configuration is placed as data-* attributes on this element.

AttributeDescription
data-site-idThe site ID from your Quipthread dashboard.
data-page-idA unique identifier for the current page (e.g. post slug, URL path). Comments are scoped to this value.
AttributeDefaultDescription
data-page-urlThe canonical URL of the page. Stored with comments for reference in the dashboard.
data-page-titleThe title of the page. Stored with comments for display in the dashboard.
data-langenUI language for the widget.
data-themeTheme preset name. If omitted or set to auto, follows the theme configured in the dashboard for this site, falling back to system preference. See Theming.

If you set data-theme on the container element, it takes priority over the site’s dashboard theme setting. Set it to auto to revert to the dashboard setting with a system-preference fallback.

The widget also observes changes to data-theme on the container element at runtime, so you can drive theme switching from your own page-level toggle by updating the attribute.

The async attribute is recommended. The script defers mounting until DOMContentLoaded if the DOM is not yet ready.

<script src="https://your-instance.com/embed.js" async></script>

The widget targets modern browsers (ES2020+). It uses createRoot from React 19, MutationObserver, and fetch. It does not support IE11 or other legacy environments.