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 example https://www.example.com. No wildcards: https://example.com and https://www.example.com are 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

html
<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.

AttributeRequiredWhat it does
data-assistantYesYour public key.
data-langNoThe 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-positionNoright (default) or left. In Arabic the button goes to the left by default.
data-launcher="none"NoHides the button: you open the assistant from your own button.
data-check="idle"NoHides 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

html
<button onclick="OphiryAssistant.open()">Ask a question</button>
<script>
  window.OphiryAssistant = window.OphiryAssistant || { q: [] };
  OphiryAssistant.q.push(["ask", "What does your product do?"]);
</script>
CallEffect
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.com
  • script-src is 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.

Frequently asked questions

Can someone copy my key and use the assistant on their own site?

No. The browser shows the panel only on the addresses you allowed. Scripts that call Ophiry directly are limited per visitor, per network and per assistant, and your daily and monthly quotas cap what anyone can use.

Does the assistant slow my page down?

The button is a small deferred script that waits until the page is idle, and the panel loads only on the first click. With the inline variant, your page makes no request to Ophiry before a click.

What happens when my quota is used up or the assistant is paused?

The button stays (unless you used data-check="idle"); on click, the visitor sees your polite "unavailable" message and your contact button.

Read next

Turn your documents into a knowledge base

Upload your files, the AI writes a clear knowledge base with its sources, and your team asks it questions. Free trial, no card.