What is the Web SDK?
The Web SDK is a small piece of code you drop into your website. When a visitor clicks a “Talk to us” button, it opens a live voice conversation with your OneInbox agent — right in the browser, using their microphone. Think of it like a live chat widget, but for voice. What it handles for you:- Asking the browser for microphone permission
- Streaming audio in real time (both directions)
- Showing live transcripts as the conversation happens
- Mute, unmute, and hang up
- An agent on OneInbox (the AI that answers)
- A button or widget on your site that starts the call
Quick steps — the simplest way to add it to your site
This is the fastest path: a publishable key + the Web SDK, no backend required.1
Create your agent
Build the agent that will answer calls — see Quickstart if you haven’t made one yet. Save its
id (agt_…).2
Create a publishable key
In the OneInbox dashboard, go to Settings → Publishable Keys → Create key. Enter the allowed origins for this key — one per line:
Copy the key — it starts with
oi_pk_live_….3
Install the Web SDK
4
Wire it to your agent
Initialize the SDK with your publishable key, then point
start() at your agent’s id:5
Add a button on your site
Wire that
start() call to any button — e.g. “Talk to us.” When a visitor clicks it, the call begins right there in the browser, using their mic.How it fits into your product
When a visitor clicks “Call”:- Your website asks your server: “start a call for this visitor”
- Your server creates the call via the OneInbox API and gets back a short-lived access token
- The Web SDK uses that token to connect the visitor’s browser to the agent
- The conversation starts — live, two-way voice
Two packages
Both do the same thing. The React package just wraps the core one with React-friendly patterns.
Install
Vanilla example
What you can listen to
Controls
React example
useOneInbox() gives you everything you need to build a call UI: