Skip to main content
Version: v1

VoiceBot SDK

VoiceBot puts an AI store assistant on every surface you ship — your website, your native mobile apps — speaking and typing in your customers' language, grounded in your real catalog. A customer taps a launcher, talks or types, and the bot searches your products, opens pages, applies filters, and adds to the cart through handlers you control.

Integration is stack-agnostic: any backend can push the catalog, any frontend can mount the widget, and the assistant's language is a per-store setting — the same product works for a Shopify-style storefront, a custom Django shop, or a React Native app.

Pick your path

There are three integration paths. They are independent and compose freely — most stores wire the first two and are live; mobile is optional.

1. Backend — get your catalog in

A server-to-server push of your products, categories, and pages so the assistant answers from real data. Pick the producer that matches your stack:

Start at Backend — get your catalog in.

2. Frontend — add the widget

The talking widget your end users see on your website — one component (or one script tag), one publishable pk_ key:

  • Vanilla JS — a single <script> tag, no package
  • React@monoverse/voicebot-react
  • Vue@monoverse/voicebot-vue
  • Next.js@monoverse/voicebot-next

Start at Frontend — add the widget.

3. Mobile — the assistant inside your app

The same assistant in a native app via a headless SDK — you own the UI and the tool handlers:

  • React Native@monoverse/voicebot-react-native (npm)
  • Fluttervoicebot_flutter (pub.dev)

Start at the Quickstart — mobile path.

Running a custom storefront?

Custom site integration is the end-to-end map for custom sites — a backend × frontend stack matrix covering the capability grant (host_profile), the cart/variant bridge, and confirmation behavior.

New to the architecture? Read Architecture and Tenant isolation first. Wondering which credential goes where? See API keys.

What it is

  • Voice + text in one session. Realtime microphone streaming (PCM16) and text turns share a single WebSocket.
  • One assistant, every surface. The web widget and the mobile SDKs are behaviorally identical — same lifecycle, same wire protocol, same bot.
  • Grounded in your data. The bot answers from the catalog and content your backend ingests — it never guesses prices or stock.
  • Your language. The assistant's language is a per-store setting, not a code change.

Architecture

The single most important architectural fact:

The assistant runs 100% server-side. No AI model ships in your page or your app binary.

Clients only do audio/text I/O — they capture input and play or render the bot's output. Everything else (the LLM, retrieval-augmented catalog search, tool execution) stays on the VoiceBot backend, for the web widget and the mobile SDKs alike.

┌──────────────┐ PCM16 16 kHz (up) ┌──────────────┐ audio/pcm ┌─────────────┐
│ Your site │ ─────────────────────▶ │ VoiceBot │ ──────────────▶ │ Gemini Live │
│ or app │ raw WebSocket frames │ backend │ server-side │ (voice+LLM) │
│ (I/O only) │ ◀───────────────────── │ (Gemini │ ◀────────────── │ │
└──────────────┘ PCM16 24 kHz (down) │ bridge, │ └─────────────┘
│ + JSON control │ RAG, tools) │
│ └──────────────┘
│ deep links / cart handlers ▲
▼ │ signed ingest (HMAC)
your routes / cart API your backend (catalog producer)

Native mobile SDKs

The mobile SDKs are headless: they give you a typed client/session state machine and an event stream — drop them behind any component tree. (On the web, the browser widget self-mounts — same assistant, same backend, no wiring.)

  • One key for web + app. Your existing VoiceBot key authorizes the mobile app too. See Auth & API keys.
  • Two native SDKs, one contract. @monoverse/voicebot-react-native (npm) and voicebot_flutter (pub.dev) speak the same wire protocol.

Why raw WebSocket + PCM16 (not WebRTC)

The transport is a raw WebSocket carrying binary PCM16 frames — the same path the web widget already uses (ADR-049). WebRTC's headline advantage is low-latency peer-to-peer media, but there is no peer-to-peer here: every turn hops device → our backend → Gemini. That mandatory Gemini hop erases the WebRTC latency win, while WebRTC would add SFU/TURN/ICE/DTLS infrastructure for no payoff. Hardware echo cancellation on the device (.voiceChat on iOS, VOICE_COMMUNICATION + AcousticEchoCanceler on Android) covers the echo case WebRTC is often chosen for.

See Audio & permissions for the native audio details.

What the SDK ships

LayerWhat it doesNative code?
Headless coreVoicebotClient / VoicebotSession state machine, WebSocket transport (reconnect ≤3, ~25s heartbeat, 60s reattach), protocol codec, tool-handler registry, deep-link map, event streamsNo
Text pathsendTexttranscript round-tripNo native code at all
Native audiomic → PCM16 16 kHz → WS; WS → PCM16 24 kHz → speaker; hardware AEC; barge-in flushYes (voice only)
Optional UI kitVoiceButton, ChatPanel — fully replaceableNo

Next steps