Skip to main content

Enable live assist

@oxvo/live-assist adds real-time support capabilities on top of @oxvo/browser.

Prerequisites

  • @oxvo/browser is already configured and starts successfully.
  • Browser permissions for microphone/camera are available when a call starts.
  • Your infrastructure allows WebSocket traffic to /assist/ws.

Install and register the plugin

npm i @oxvo/live-assist
import { browser } from '@oxvo/browser';
import browserAssist from '@oxvo/live-assist';

browser.configure({
siteKey: 'YOUR_SITE_KEY',
endpoint: 'https://sessions.example.com/oxvo',
});

const assist = browser.use(
browserAssist({
onAgentConnect: agent => {
console.log('Agent connected', agent);
return () => console.log('Agent disconnected');
},
onCallStart: () => {
console.log('Call started');
return () => console.log('Call ended');
},
onRemoteControlStart: agent => {
console.log('Remote control started by', agent?.name);
return () => console.log('Remote control ended');
},
onCallDeny: () => console.log('User denied call'),
onRemoteControlDeny: agent => console.log('Remote control denied', agent),
onRecordingRequest: agent => console.log('Recording requested', agent),
onRecordingDeny: agent => console.log('Recording denied', agent),
serverURL: 'https://sessions.example.com',
compressionEnabled: true,
compressionMinBatchSize: 6000,
})
);

const result = await browser.start();
if (!result.success) console.error(result.reason);

Register assist before start() so lifecycle callbacks attach on first session boot.

browser.use(
browserAssist({
callConfirm: {
text: 'Support requested a live call. Continue?',
confirmBtn: 'Answer',
declineBtn: 'Decline',
},
controlConfirm: {
text: 'Allow remote control for guided troubleshooting?',
confirmBtn: 'Allow control',
declineBtn: 'Reject',
},
recordingConfirm: {
text: 'Allow browser activity recording for this assist session?',
confirmBtn: 'Allow recording',
declineBtn: 'Reject',
},
})
);

Important options

OptionPurpose
onAgentConnectFires when a support agent joins
onCallStartFires when a call starts
onRemoteControlStartFires when remote control becomes active
onCallDeny, onRemoteControlDeny, onRecordingDenyHooks for denied consent outcomes
session_calling_peer_key, session_control_peer_keySession storage keys for call/control continuity
serverURLBase URL for assist socket host/path resolution
socketHostHost override (for specialized routing/proxy needs)
callUITemplateCustom call widget template URL
compressionEnabledCompresses large assist delta batches
compressionMinBatchSizeCompression threshold (message count)

Operational behavior to expect

  • The plugin reconnects agent state after browser restarts.
  • Call and remote-control state are synchronized across tabs.
  • Assist metadata (active tab status, page title, session updates) is emitted through SESSION_SYNC.

Warning: Calls and remote control depend on explicit user consent and browser media permissions. Always provide clear copy in confirmation prompts.

Live assist consent and control flow