Quickstart: script tag

A working chat widget on a page, with no build step and no npm install.

Browser Embed key dev · https://api.dev.oprag.ai
  1. 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.

  2. Allowlist the origin the page is served from

    Embed keys only work from an origin you have allowlisted, and a request with no Origin header at all is refused with 403. Add https://your-site.example — and your local origin, if you are testing there — to the project's allowed origins.

  3. 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>
  4. 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