← Back to the demo

How it works

How the demo works

One snippet, page-type from meta tags

The publisher pastes the same <script src="/widget.js" data-site-id="…"> on every page. The widget reads each page's <meta property="ai:type"> (→ og:type → generic) and builds the prompt from the matching template. No per-page param.

Why the demo uses an iframe

The widget mounts one live instance per document and reads its config from the parsed<script>. To switch params live, the demo rebuilds an <iframe>'ssrcdoc — each change is a fresh, real page load.

Two prompt layers

The widget's client-side share prompt uses a template fallback and has no tone. Tone is applied server-side and delivered via the cached /preview. The Prompt Inspector shows the real server-side prompt (template + tone); Live mode shows the widget's actual cached preview.

Full protocol: the Ask protocol on askthis.dev.