WebSocket Browser SDK
Build web-based voice assistants with the VEXYL JavaScript SDK. Connect directly to the gateway from any browser.
Installation
<script src="https://your-server.com/aivg-sdk.js"></script>
Basic Usage
const voice = new AIVoiceGateway({
serverUrl: 'wss://voice.example.com:8082',
language: 'en-IN',
onTranscript: (text) => console.log('User:', text),
onResponse: (text) => console.log('AI:', text)
});
await voice.connect();
await voice.startListening();
Security
In production, restrict origin access using the WEBSOCKET_AUDIO_ALLOWED_ORIGINS environment variable.