Enable live assist
@oxvo/live-assist adds real-time support capabilities on top of @oxvo/browser.
Prerequisites
@oxvo/browseris 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.
Consent and prompt customization
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
| Option | Purpose |
|---|---|
onAgentConnect | Fires when a support agent joins |
onCallStart | Fires when a call starts |
onRemoteControlStart | Fires when remote control becomes active |
onCallDeny, onRemoteControlDeny, onRecordingDeny | Hooks for denied consent outcomes |
session_calling_peer_key, session_control_peer_key | Session storage keys for call/control continuity |
serverURL | Base URL for assist socket host/path resolution |
socketHost | Host override (for specialized routing/proxy needs) |
callUITemplate | Custom call widget template URL |
compressionEnabled | Compresses large assist delta batches |
compressionMinBatchSize | Compression 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.
