Skip to main content

Quickstart

Three routes, one assistant. They are independent — do them in any order, skip what you don't need. Which credential each route uses is one table in API keys.

RouteYou needTime
A. Website widgeta pk_ publishable key~5 minutes
B. Backend catalog syncyour pk_ publishable key~30 minutes
C. Mobile appyour site's pk_ with your app ids (or your server)~30 minutes
The SDK packages are not published yet

npm install @monoverse/…, pip install monoverse, composer require monoverse/laravel and flutter pub add monoverse_flutter do not resolve yet. Until they do, put the widget on your site with the script tag and get your catalog in with the WordPress plugin.

The widget needs data to talk about

Route A mounts the widget; route B feeds it your catalog. Until a backend sync runs, the assistant has nothing real to say — wire both for a live store.

A. Website widget​

Before you install

What the widget does on your pages: the scripts it loads, the calls it makes, what it stores and when it uses the microphone.

Get a publishable key pk_… from your Monoverse cabinet (Integrations) and register the exact origins allowed to use it. Then drop one tag anywhere in your page:

<script
src="https://api.monoverse.tech/widget/widget-voice.js"
data-public-key="pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
async
></script>

If your site runs a consent platform, carry its decision with data-consent="granted" (or "denied") on the same tag — it decides whether the widget's visitor identifier is stored for the session only or persistently. See the Consent contract for the full contract: the three inputs, the exact tokens, what each tier stores, and what that means for your cookie policy.

The deployed bundle self-mints an origin-locked session and mounts the launcher. That's the whole integration for a vanilla site. Shipping a framework?

  • React — npm install @monoverse/react
  • Vue — npm install @monoverse/vue
  • Next.js — npm install @monoverse/next
  • Vanilla JS — the script tag above, plus optional attributes

Custom storefront with its own cart? Continue with Custom site integration to wire cart/variant actions.

B. Backend catalog sync​

Every producer follows the same shape — pair once, push a full snapshot, then deltas:

  1. Pair with your pk_ — the SDK proves it runs on the key's domain and receives a per-tenant HMAC shared secret, stored encrypted (Pairing a backend).
  2. Full snapshot — stream every product, category, and page as gzipped NDJSON.
  3. Deltas — push small signed batches as your data changes, on your own schedule.

Pick your stack:

The umbrella page is Backend — get your catalog in.

C. Mobile app​

The React Native and Flutter SDKs are in beta.

Get a text session running in about 30 minutes, then add voice. Pick your SDK — the rest of this section follows your choice.

Text works immediately. Voice needs a real device.

The text path uses zero native code and runs in a simulator. Voice requires a real device plus the native audio module (an emulator microphone is unreliable). Voice failure is non-fatal — the text path keeps working.

C1. Get your publishable key​

The fastest start is Mode B (publishable key) — no backend required. Your app uses your site's own pk_ key, the one your website widget uses. In your Monoverse cabinet, go to:

Cabinet → Integrations → your site → Mobile apps

Add your app's iOS bundle id and Android package (e.g. com.yourco.app) to the site's key. The site's catalog must be connected first (website or plugin). Copy the pk_… shown beside your site. It is an identifier, not a secret, and is safe to ship in your app binary (like a Stripe pk_).

For production apps that already have a backend, prefer Mode A (server-minted) so no key is embedded at all. Both modes are covered in Auth & API keys.

C2. Install​

npm install @monoverse/react-native react-native-nitro-modules
# iOS:
cd ios && pod install

The native audio module uses the New Architecture (default on RN 0.76+). Text chat works without it; voice does not.

Expo: this SDK ships a native module, so it does not run in Expo Go. Use a dev build:

npx expo install @monoverse/react-native react-native-nitro-modules expo-dev-client
app.json
{ "expo": { "plugins": ["@monoverse/react-native/app.plugin"] } }
npx expo run:ios # or: npx expo run:android

The config plugin wires NSMicrophoneUsageDescription (iOS) and RECORD_AUDIO (Android).

C3. Init the client​

Constructing the client is synchronous and does no network — it just configures it.

import { MonoverseClient } from '@monoverse/react-native';

const client = new MonoverseClient({ publicKey: 'pk_…', appId: 'com.yourco.app', lang: 'en' });

C4. Map the bot's UI actions​

The bot runs catalog lookups server-side and just speaks the result. For UI actions (open a product, add to cart, apply a filter) it pushes an action; the SDK runs your handler or fires a deep link, then acknowledges the backend for you. An action with no registered handler degrades safely — the bot adapts, your app never crashes. Full table in Tool handlers & deep links.

client.registerToolHandler('add_to_cart', async ({ id, qty }) => {
await myCart.add(String(id), Number(qty));
return { success: true, cartItemCount: myCart.count };
});
client.registerDeepLinkMap('open_product', ({ id }) => `myapp://product/${String(id)}`);

C5. Start a session and listen​

This is the launcher action — wire it to your "open assistant" button.

const session = await client.startSession({ lang: 'en' }); // any supported language code

session.on('transcript', (t) => console.log(t.role, t.text)); // works on the text path alone
session.on('status', (s) => console.log(s.status));
session.on('error', (e) => console.warn(e.code, e.message));
session.on('ended', (e) => console.log('ended', e.reason));

// A text turn works right now — no microphone needed:
session.sendText('how much is the laptop?');

C6. Add voice​

Voice needs a real device and the native audio module. Failure is non-fatal — text keeps working.

// startVoice() requests the mic permission for you, then captures.
// Denial is non-fatal — it rejects and text keeps working.
session.startVoice().catch((err) => console.warn('voice unavailable', err));

session.setMuted(true); // mute the mic mid-session
session.minimize(); // collapse the UI — session STAYS ALIVE (no end sent)
session.restore(); // un-collapse
await session.endSession(); // user closed the chat → real end + teardown
minimize ≠ close

minimize() is UI-only — the session and WebSocket stay alive. Only endSession() ends the session. Wire your "collapse" control to minimize() and your "X" to endSession(). See Lifecycle.

Where to go next​