Quickstart: script tag
A working chat widget on a page, with no build step and no npm install.
Create an embed key
In the dashboard, open your project and create an embed key. Start with
embed_test_— it answers from a fixed test response, so you can confirm the wiring before any document is ingested.Allowlist the origin the page is served from
Embed keys only work from an origin you have allowlisted, and a request with no
Originheader at all is refused with 403. Addhttps://your-site.example— and your local origin, if you are testing there — to the project's allowed origins.Drop the script on the page
index.html HTML <script src="https://cdn.oprag.ai/widget.js" data-project="proj_abc123" data-embed-key="embed_test_..." data-api-url="https://api.dev.oprag.ai" ></script>Ask it something
Load the page and open the launcher. With a test key you get the fixed test answer back, which confirms the key, the origin, and the API URL are all right. Swap in
embed_live_when your documents are ingested.
Every attribute the script accepts is listed under script attributes. For typed control over the same widget, move on to the npm widget quickstart.
Ready to ship?
Get started free