Integration guide

Connect Arjun to your website

Arjun first reads your whole website, then answers your visitors by voice or chat, in Hindi, Hinglish or English. There are three ways to add it. Pick the one that fits you:

MethodBest forEffort
Script tagAny website. WordPress, Shopify, Wix, Webflow, plain HTML2 minutes, no coding
REST APIYour own app, mobile app, WhatsApp bot or custom chat UIA developer, 30 minutes
Live voice (WebRTC)Talking to the assistant. Built into the script tag, also available via APIIncluded

Quick start

Three steps from nothing to a talking website.

  1. 1
    Sign in to your dashboard (we send you a set-up link when you sign up), click Add website, and enter your business name and website link.
  2. 2
    Wait about a minute while the assistant reads your site. The status changes from Learning to Live, and you see every page it learned.
  3. 3
    Copy the script tag from the dashboard and paste it into your website (next section). Done.
The dashboard also shows your secret API key once. Save it somewhere safe if you plan to use the REST API. You can create a new one anytime.

Script tag (easiest)

Paste this single line just before the closing </body> tag of your pages. Your data-site-key comes from the dashboard.

index.html
<script
  src="https://YOUR-WIDGET-HOST/widget.js"
  data-site-key="pk_xxxxxxxxxxxxxxxx"
  async></script>

A floating button appears at the bottom corner. Visitors click it to chat or talk.

Customise it

AttributeWhat it doesExample
data-site-keyRequired. Identifies your site.pk_8f3a…
data-colorBrand colour of button and chat#E8512B
data-nameName on the button and chat headerRaj Mobiles
data-positionWhich cornerbottom-left
data-labelSmall greeting bubble next to the buttonPoochiye πŸ‘‹
data-apiOnly if your API lives on a different address than the widgethttps://api.example.com/api/v1
fully customised
<script
  src="https://YOUR-WIDGET-HOST/widget.js"
  data-site-key="pk_xxxxxxxxxxxxxxxx"
  data-name="Raj Mobiles"
  data-color="#E8512B"
  data-position="bottom-right"
  data-label="Kuch poochna hai?"
  async></script>
Your website address (and its www version) is allowed automatically. If you serve the page from another domain, such as a staging site, add it under allowed origins (see Security).

WordPress, Shopify, Wix and more

The same script tag works everywhere. Only the place you paste it changes.

WordPress

  1. 1
    Install the free plugin WPCode (or "Insert Headers and Footers").
  2. 2
    Go to Code Snippets β†’ Header & Footer.
  3. 3
    Paste the script tag into the Footer box and click Save.

Shopify

  1. 1
    Go to Online Store β†’ Themes β†’ … β†’ Edit code.
  2. 2
    Open layout/theme.liquid.
  3. 3
    Paste the script tag just above </body> and click Save.

Wix

  1. 1
    Open Settings β†’ Custom Code and click Add Custom Code.
  2. 2
    Paste the script tag, set Place code in: Body – end, apply to All pages.
  3. 3
    Click Apply and publish your site.

Squarespace & Webflow

Squarespace: Settings β†’ Advanced β†’ Code Injection β†’ Footer. Webflow: Project Settings β†’ Custom Code β†’ Footer Code. Paste the script tag and publish.

React / Next.js

app/layout.tsx (Next.js)
import Script from 'next/script';

export default function RootLayout({ children }) {
  return (
    <html>
      <body>
        {children}
        <Script
          src="https://YOUR-WIDGET-HOST/widget.js"
          data-site-key="pk_xxxxxxxxxxxxxxxx"
          strategy="afterInteractive"
        />
      </body>
    </html>
  );
}

For plain React (Vite or CRA), add the same script tag at the end of index.html.

REST API

Use the API to put the assistant inside your own app, a mobile app or a custom chat box. Base URL: https://YOUR-API-HOST/api/v1

Two ways to authenticate

WhereHowUse for
Server to serverHeaders x-site-key + x-api-key (secret)Your backend calls Arjun. Never put the secret key in a browser or app.
BrowserCall /public/session to get a short-lived visitor token, then send Authorization: Bearer <token>A custom chat UI in the browser. Your page origin must be allowed.
The secret API key (sk_…) must stay on your server. The site key (pk_…) is public and safe to show in page source.

Send a message

POST/public/chatAsk a question, get an answer from your website content
curl
curl -X POST https://YOUR-API-HOST/api/v1/public/chat \
  -H "Content-Type: application/json" \
  -H "x-site-key: pk_xxxxxxxxxxxxxxxx" \
  -H "x-api-key: sk_your_secret_key" \
  -d '{"message": "Aapki timing kya hai?"}'
Body fieldTypeNotes
messagestring, 1–1000 charsRequired. Hindi, Hinglish or English.
conversationIdstringSend the previous value to keep context across turns.
audiobooleantrue returns an mp3 of the answer as base64.

Response:

200 OK
{
  "conversationId": "vc_9f2a1c3d4e5f",
  "answer": "Hum roz subah 10 se raat 9 baje tak khule hain.",
  "sources": [{ "title": "Contact", "url": "https://rajmobiles.in/contact" }],
  "audioBase64": null,
  "configured": true
}

Get a browser visitor token

POST/public/sessionBrowser only. The request Origin must be allowed
request
POST /api/v1/public/session
Content-Type: application/json

{ "siteKey": "pk_xxxxxxxxxxxxxxxx" }
200 OK
{
  "token": "eyJhbGciOi…",
  "expiresAt": "2026-11-20T18:30:00.000Z",
  "site": { "name": "Raj Mobiles", "greeting": "Namaste! …", "voice": "alloy", "status": "READY" }
}

Tokens last one hour. Request a new one when you get 401.

Other endpoints

GET/public/siteName, greeting, status and pages learned
POST/public/searchRaw search: { query } returns the matching passages
POST/public/realtime-tokenShort-lived key for live voice (see Voice)

Manage your sites (owner API)

These are what the dashboard uses. They need an owner identity (dashboard login, or your server's x-issuer-key).

POST/sitesRegister a website. Body: { name, url } and starts reading it
GET/sitesList your websites
GET/sites/:idStatus, pages learned, embed snippet
POST/sites/:id/crawlRe-read the website after you change content
PATCH/sites/:idChange name, greeting, voice or allowed origins
POST/sites/:id/rotate-keyCreate a new secret key. The old one stops working
DELETE/sites/:idRemove the site and everything it learned

Errors & limits

StatusCodeMeaning
401INVALID_SESSIONToken expired or wrong. Request a new session.
401SITE_AUTH_REQUIREDMissing token or API key headers.
403ORIGIN_NOT_ALLOWEDThis page address is not in your allowed origins.
404UNKNOWN_SITEThe site key does not exist.
429RATE_LIMITEDToo many requests. Chat 30/min, session 20/min, voice 6/min per visitor.

Voice

With the script tag, voice is already included. Visitors press the microphone button and talk. They can interrupt the assistant anytime, like a phone call.

  1. 1
    The browser asks the visitor for microphone permission (one time).
  2. 2
    Arjun's server creates a short-lived key for the visitor. Your real OpenAI key is never sent to a browser.
  3. 3
    The browser connects directly for low-delay, natural speech. Facts come from your website through a built-in search.
Two voice modes. With an OPENAI_API_KEY on the Arjun backend you get natural AI answers and live OpenAI voice. Without a key the widget runs in free mode: answers are quoted straight from your website (never invented), and voice uses the visitor's browser, best in Chrome or Edge, in Hindi or English. Both need a secure page (https, or localhost while testing). The chat box also has a speaker button that reads typed answers aloud.

Building your own voice UI? Call POST /public/realtime-token with a visitor token. You get clientSecret, model and voice to start a WebRTC session. The live widget source (/embed.html) is a working reference.

Voice actions: do things, not just talk

Besides answering questions, the assistant can act on a spoken or typed command: open YouTube, download a file, fill a form, open an app. There are two audiences, with very different powers:

WhoWhat they can doWhere
Website visitorsOnly what the site owner allows: open YouTube or Google, go to a page of the site, download declared files, fill declared formsInside the visitor browser page only. Never a computer or phone
The owner (you)Open links and YouTube, download files, fill forms in your portal, and on a paired computer: open apps and folders, shut downThis browser (no setup) or a paired Windows computer

For website owners: let visitors act

  1. 1
    In My websites β†’ Voice commands for your visitors, switch it on and add the files visitors may download (name, link, search words).
  2. 2
    Mark a form so it can be filled by voice. Only marked forms are ever touched:
your page
<form data-arjun-form="booking" data-arjun-label="Booking form">
  <input name="name"  placeholder="Your name">
  <input name="phone" placeholder="Mobile number">
  <input name="email" placeholder="Email">
</form>
Password, card, OTP and hidden fields are never filled, even if someone says them aloud. The visitor presses Submit themselves, unless you add data-arjun-submit="allow".

For owners: control your own computer

  1. 1
    Open Voice & devices β†’ Add computer and choose what it may do: Basic (links, YouTube), Standard (downloads, forms), Advanced (apps, folders), System (shut down).
  2. 2
    On that computer run the one-time command shown (it needs Node.js): npm run agent:pair -- ABCD-EFGH --server https://YOUR-API-HOST
  3. 3
    Start it with npm run start:agent and leave it running. Then press the microphone button on any portal page and pick the computer.
SayWhat happens
youtube par arijit singh ke gaane chalaoOpens YouTube search at once
chrome kholoAsks "Confirm?" then opens Chrome (unless you trusted that permission)
download https://…/report.pdfSaves it to Downloads/Arjun. Programs (.exe, .bat…) are never downloaded
downloads folder kholoOpens the folder
laptop band karoAlways asks first, then shuts down in 60 seconds
Remove a computer in the portal and it is disconnected immediately. Every command, allowed or refused, is written to the activity log. The platform admin can switch voice actions off for an account.

Your phone: the portal and the widget work in the phone's browser (YouTube, downloads, forms). Controlling other apps on a phone needs a native Android app, which is not built yet. iPhone does not allow it.

Security

Allowed origins

Only pages on your registered website can start a browser session. Your site address and its www twin are allowed automatically. To allow another address (staging, a second domain), update the site:

PATCH /sites/:id
{ "allowedOrigins": ["https://staging.rajmobiles.in", "https://shop.rajmobiles.in"] }

Keys

  • Site key (pk_…) is public. It only identifies which assistant to load.
  • Secret key (sk_…) is for your server only. It is shown once. Lost or leaked? Rotate it from the dashboard.
  • Visitors can only ask questions about your website. They cannot reach any other data.

What the assistant will and will not do

It answers only from your website content and says so honestly when it does not know. It never takes payments, places orders or accesses accounts.

Troubleshooting

ProblemFix
The button does not appearCheck the script is before </body>, the site key is correct, and the browser console has no blocked-script error.
Chat says "Unavailable" or 403The page address is not allowed. Add it to allowedOrigins.
Answers are empty or "I do not know"Wait until status is Live, then check the pages list in the dashboard. Click Re-read after you add new pages.
Some pages were not learnedPages behind a login, or built only by JavaScript, cannot be read. Add them to your sitemap.xml or put the key text in normal page HTML.
Microphone button does nothingVoice needs https (or localhost) and microphone permission. Check the OpenAI key is set on the backend.
The widget appears but cannot connectWidget and API must be reachable. If the API is on another address, set data-api on the script tag.

Ready to try it?

Add your website and have a talking assistant in minutes.

Open dashboard