@evalage/sdk-web
v0.1.2
Published
Web SDK for ReplicaVAPi voice service (mic capture + playback + auto cleanup).
Downloads
141
Readme
@evalage/sdk-web
Browser audio layer on top of @evalage/sdk-core.
Install
npm install @evalage/sdk-webUsage
import { EvalageWebClient } from '@evalage/sdk-web';
const client = new EvalageWebClient({
serverUrl: import.meta.env.VITE_SERVER_URL,
platformApiKey: import.meta.env.VITE_PLATFORM_API_KEY,
assistantId: import.meta.env.VITE_ASSISTANT_ID,
});
await client.connect();
await client.attachSpeaker();
await client.attachMicrophone();
client.startCall({});
// stop from UI
await client.stop();Behavior
- Mic audio is captured with WebAudio (ScriptProcessor), resampled to 48k, converted to PCM16, and streamed to the server.
- Agent audio chunks are assumed PCM16 @ 24k and played via WebAudio buffers.
- Local mic capture is always stopped immediately if the server ends the call.
- Speaker playback is drained before teardown by default (prevents cutting off the final sentence).
Events
- The server can emit
call-ended/agent-closeat any time. EvalageWebClientalso emitsclient-closedonly after mic is stopped and speaker audio is drained (or timeout). Prefer this for UI teardown.
