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:
| Method | Best for | Effort |
|---|---|---|
| Script tag | Any website. WordPress, Shopify, Wix, Webflow, plain HTML | 2 minutes, no coding |
| REST API | Your own app, mobile app, WhatsApp bot or custom chat UI | A developer, 30 minutes |
| Live voice (WebRTC) | Talking to the assistant. Built into the script tag, also available via API | Included |
Quick start
Three steps from nothing to a talking website.
- 1Sign 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.
- 2Wait about a minute while the assistant reads your site. The status changes from
LearningtoLive, and you see every page it learned. - 3Copy the script tag from the dashboard and paste it into your website (next section). Done.
Script tag (easiest)
Paste this single line just before the closing </body> tag of your pages. Your data-site-key comes from the dashboard.
<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
| Attribute | What it does | Example |
|---|---|---|
data-site-key | Required. Identifies your site. | pk_8f3a⦠|
data-color | Brand colour of button and chat | #E8512B |
data-name | Name on the button and chat header | Raj Mobiles |
data-position | Which corner | bottom-left |
data-label | Small greeting bubble next to the button | Poochiye π |
data-api | Only if your API lives on a different address than the widget | https://api.example.com/api/v1 |
<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>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
- 1Install the free plugin WPCode (or "Insert Headers and Footers").
- 2Go to Code Snippets β Header & Footer.
- 3Paste the script tag into the Footer box and click Save.
Shopify
- 1Go to Online Store β Themes β β¦ β Edit code.
- 2Open
layout/theme.liquid. - 3Paste the script tag just above
</body>and click Save.
Wix
- 1Open Settings β Custom Code and click Add Custom Code.
- 2Paste the script tag, set Place code in: Body β end, apply to All pages.
- 3Click 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
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
| Where | How | Use for |
|---|---|---|
| Server to server | Headers x-site-key + x-api-key (secret) | Your backend calls Arjun. Never put the secret key in a browser or app. |
| Browser | Call /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. |
sk_β¦) must stay on your server. The site key (pk_β¦) is public and safe to show in page source.Send a message
/public/chatAsk a question, get an answer from your website contentcurl -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 field | Type | Notes |
|---|---|---|
message | string, 1β1000 chars | Required. Hindi, Hinglish or English. |
conversationId | string | Send the previous value to keep context across turns. |
audio | boolean | true returns an mp3 of the answer as base64. |
Response:
{
"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
/public/sessionBrowser only. The request Origin must be allowedPOST /api/v1/public/session
Content-Type: application/json
{ "siteKey": "pk_xxxxxxxxxxxxxxxx" }{
"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
/public/siteName, greeting, status and pages learned/public/searchRaw search: { query } returns the matching passages/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).
/sitesRegister a website. Body: { name, url } and starts reading it/sitesList your websites/sites/:idStatus, pages learned, embed snippet/sites/:id/crawlRe-read the website after you change content/sites/:idChange name, greeting, voice or allowed origins/sites/:id/rotate-keyCreate a new secret key. The old one stops working/sites/:idRemove the site and everything it learnedErrors & limits
| Status | Code | Meaning |
|---|---|---|
| 401 | INVALID_SESSION | Token expired or wrong. Request a new session. |
| 401 | SITE_AUTH_REQUIRED | Missing token or API key headers. |
| 403 | ORIGIN_NOT_ALLOWED | This page address is not in your allowed origins. |
| 404 | UNKNOWN_SITE | The site key does not exist. |
| 429 | RATE_LIMITED | Too 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.
- 1The browser asks the visitor for microphone permission (one time).
- 2Arjun's server creates a short-lived key for the visitor. Your real OpenAI key is never sent to a browser.
- 3The browser connects directly for low-delay, natural speech. Facts come from your website through a built-in search.
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:
| Who | What they can do | Where |
|---|---|---|
| Website visitors | Only what the site owner allows: open YouTube or Google, go to a page of the site, download declared files, fill declared forms | Inside 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 down | This browser (no setup) or a paired Windows computer |
For website owners: let visitors act
- 1In My websites β Voice commands for your visitors, switch it on and add the files visitors may download (name, link, search words).
- 2Mark a form so it can be filled by voice. Only marked forms are ever touched:
<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>data-arjun-submit="allow".For owners: control your own computer
- 1Open Voice & devices β Add computer and choose what it may do: Basic (links, YouTube), Standard (downloads, forms), Advanced (apps, folders), System (shut down).
- 2On that computer run the one-time command shown (it needs Node.js):
npm run agent:pair -- ABCD-EFGH --server https://YOUR-API-HOST - 3Start it with
npm run start:agentand leave it running. Then press the microphone button on any portal page and pick the computer.
| Say | What happens |
|---|---|
youtube par arijit singh ke gaane chalao | Opens YouTube search at once |
chrome kholo | Asks "Confirm?" then opens Chrome (unless you trusted that permission) |
download https://β¦/report.pdf | Saves it to Downloads/Arjun. Programs (.exe, .batβ¦) are never downloaded |
downloads folder kholo | Opens the folder |
laptop band karo | Always asks first, then shuts down in 60 seconds |
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:
{ "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
| Problem | Fix |
|---|---|
| The button does not appear | Check the script is before </body>, the site key is correct, and the browser console has no blocked-script error. |
| Chat says "Unavailable" or 403 | The 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 learned | Pages 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 nothing | Voice needs https (or localhost) and microphone permission. Check the OpenAI key is set on the backend. |
| The widget appears but cannot connect | Widget and API must be reachable. If the API is on another address, set data-api on the script tag. |