What you’ll build
By the end of this guide your website will have a floating voice button that:- Opens a live AI voice call when clicked
- Uses your branding (colors, logo, name)
- Passes your logged-in user’s details to the agent
- Lets the agent open forms mid-call and submit them to your backend
Step 1 — Create your agent in the dashboard
- Sign in at app.oshara.ai
- Go to Characters → New Character
- Fill in:
- Slug — a URL-safe ID, e.g.
support-bot(you’ll use this in the script tag) - System prompt — what the agent should do and how it should behave
- Greeting — the first thing it says when a call starts
- Slug — a URL-safe ID, e.g.
- Under Allowed Origins, add your website domain:
- Save the character.
Step 2 — Embed the script tag
Paste this before the closing</body> tag on every page where you want the widget:
support-bot with your character’s slug. A floating button will appear in the bottom-right corner.
Test it: Open the page, click the button, allow mic access, and click Start Call. You should hear the greeting within a few seconds.
Step 3 — Customise the appearance
Go to Characters → [your character] → Widget Appearance in the dashboard and set your brand colors, logo, and panel size. Or configure it via the API:Step 4 — Pass your user’s context to the agent
When your user is logged in, you want the agent to know who they are. Do this by calling the session endpoint from your backend instead of letting the widget call it directly.Server-side session start (recommended)
Your backend calls Oshara to get a LiveKit token, then passes it to the widget. This keeps your API key server-side and lets you inject user context. Your backend (Node.js example):metadata object is available to the agent worker and can be referenced in tool calls.
Step 5 — Handle post-call form submissions
If you’ve defined forms on your character, the widget will POST submissions to yoursubmit_url. Set up an endpoint on your backend to receive them:
submit_url at this endpoint:
2xx to confirm. See Form Handling for the full form configuration reference.
Step 6 — Auto-open for dedicated landing pages
For a page whose entire purpose is the voice agent (e.g. a demo page):Checklist
- Character created with a slug
- Your domain added to Allowed Origins
- Script tag added to your site
- Call works end-to-end in the browser
- Branding configured (colors, logo, FAB label)
- User context passed via
metadata(if your site has login) - Form
submit_urlpointing at your backend (if using forms)
