Integrate the Ophiry assistant on your website
Add the Ophiry public assistant to any website in one line: plain HTML, WordPress, Webflow, Wix, Shopify, a tag manager, and the CSP lines to add.
By the Ophiry team · Updated on November 19, 2026
The Ophiry public assistant goes on your website with one script line. It answers your visitors only from the content you made public in your knowledge base, cites its sources, and loads nothing before a visitor clicks its button. This page gives the line to paste and where to paste it on the most common platforms.
Before you start
You need, in Ophiry, a knowledge base with a public assistant, and in its Integration tab:
- your test key (
pa_test_…): it works on the addresses you list as test addresses (your computer, a staging site, a platform preview address) with a small daily quota and a "test" banner; - your live key (
pa_live_…): it works only on the exact production addresses you list, for examplehttps://www.example.com. No wildcards:https://example.comandhttps://www.example.comare two addresses; - a link to your privacy policy: the assistant shows it in its panel, and it cannot go online without it. A model paragraph is ready to adapt.
The key is not a secret: it is visible in your page's code. It only works on the addresses you allowed, because the browser itself refuses to show the assistant's panel anywhere else.
The line to paste
<script src="https://widget.ophiry.com/assistant/v1/loader.js" data-assistant="pa_live_xxxxxxxxxxxxxxxxxxxxxx" data-lang="en" defer></script>Paste it once per page, just before </body>, or once in the template every page uses.
| Attribute | Required | What it does |
|---|---|---|
data-assistant | Yes | Your public key. |
data-lang | No | The language of the page (en, fr, ar…). Without it: the page's <html lang>, then the browser's language, among your knowledge base's languages. |
data-position | No | right (default) or left. In Arabic the button goes to the left by default. |
data-launcher="none" | No | Hides the button: you open the assistant from your own button. |
data-check="idle" | No | Hides the button while the assistant is paused. It adds one light request after the page has loaded. |
The address contains v1: everything on this page stays valid for as long as v1 is served. A change that would break your page gets a new address, and v1 keeps working.
Variant with no request before the click. The Integration tab also gives an inline version of the button (about 1 KB) to paste directly in your page. Your page then makes no request to Ophiry at all until a visitor clicks. Use it if you watch your page-speed score closely.
Open the assistant from your own buttons
<button onclick="OphiryAssistant.open()">Ask a question</button>
<script>
window.OphiryAssistant = window.OphiryAssistant || { q: [] };
OphiryAssistant.q.push(["ask", "What does your product do?"]);
</script>| Call | Effect |
|---|---|
OphiryAssistant.open() / .close() | Opens or closes the panel. |
OphiryAssistant.ask("…") | Opens the panel with the question filled in. It is sent when the visitor confirms. |
OphiryAssistant.on("lead", fn) | Your function runs when the visitor clicks the demo or contact button (also "open", "close", "ready"). It receives no text of the conversation. |
Platform by platform
Plain HTML
Paste the line before </body> in every page, or in the shared footer if your site has one.
WordPress
Use a "header and footer code" plugin and paste the line in the footer section, or add it to your theme's footer through the wp_footer hook. Cache and "defer JavaScript" plugins need no exception: the script is already deferred.
Webflow
Site settings → Custom code → Footer code. Publish the site to see the button. Add your webflow.io address to the test addresses, not to the production ones.
Wix
Settings → Custom code (on a premium site with its own domain) → add the line, place it at the end of the body, on all pages. A free wixsite.com address belongs in the test addresses.
Shopify
Online Store → Themes → Edit code → theme.liquid: paste the line just before </body>. Or use a "Custom liquid" block. Add your myshopify.com address to the test addresses.
Tag manager (for example Google Tag Manager)
Create a Custom HTML tag that contains the line, triggered on all pages. Publish the container. A tag manager adds a short delay before the button appears. The assistant sets no cookie, stores nothing on the visitor's device and sends no conversation data before a visitor opens it; whether it must wait for your consent banner is your decision and your adviser's.
Next.js and React
Load the line with next/script and strategy="lazyOnload", once in the root layout, with the same data-* attributes.
Astro and other static generators
Put the line in the shared layout and set data-lang from the page's language (for example data-lang={Astro.currentLocale}). The inline variant suits sites that aim for a perfect page-speed score.
Netlify, Vercel and preview deployments
Nothing special for the script. Preview deployments have changing addresses: allow them with the test key only, never with the live key. If you set a Content Security Policy in netlify.toml or vercel.json, add the lines below.
Content Security Policy
If your site sends a Content Security Policy, add two directives:
script-src https://widget.ophiry.com
frame-src https://widget.ophiry.comscript-srcis not needed with the inline variant if your policy allows that inline script by nonce or hash.- Nothing goes in
connect-src: the conversation runs inside the assistant's panel, which is served by Ophiry, not by your page. - The anti-bot check, when it runs, runs inside that panel too: your policy does not change for it.
What the assistant does on your page
- Before a click: one button, nothing else. No cookie, no storage on the visitor's device, and no request to Ophiry other than downloading the button's script (none at all with the inline variant).
- After a click: a panel served by Ophiry opens in a frame. Your page cannot read the conversation, and the panel cannot read your page.
- The panel always says that the visitor is talking to an AI and that the answers come from your site's content, and links to your privacy policy.
- On a phone the panel takes the full screen; on a larger screen it sits in a corner and your page stays usable.