Embed a thread
Connect an HTML page, a static site or a CMS. The same site and page keys open the same discussion.
Gather three values
endpointis the public Blua gateway. Replacehttps://blua.examplethroughout the examples with your own address.- Create the
site-keyin Settings → Sites. Add the website serving the article to its allowed origins, one origin per line. page-keyidentifies the article. Use an ID that survives title changes, tracking parameters and translated URLs. Assign separate keys if each translation should have its own thread.
HTML
HTML<script type="module" src="https://blua.example/embed.js"></script><blua-comments endpoint="https://blua.example" site-key="garden" page-key="spring-swallows" locale="en"></blua-comments>
Load the module once per page and place the element where the thread belongs. Update page-key when client-side navigation changes the article. See framework integration for components and SSR.
iframe
Use the gateway’s /embed document in an HTML or iframe block in your CMS. The origin referrer policy lets the gateway verify the parent site.
HTML<iframe id="discussion" title="Article comments" src="https://blua.example/embed?siteKey=garden&pageKey=spring-swallows&locale=en" referrerpolicy="origin" loading="lazy" height="640" style="width: 100%; border: 0"></iframe>
A fixed-height iframe scrolls. If the host allows module scripts, the gateway ships a helper that follows the thread height. Call the returned cleanup function when a single-page application unmounts the frame.
HTML<script type="module"> import { connectBluaFrame } from 'https://blua.example/embed/host.js'; const disconnect = connectBluaFrame(document.querySelector('#discussion'));</script>
If the host strips referrers, add the URL-encoded, registered parentOrigin to the iframe URL. Allow the gateway in the host’s frame-src policy.