voice-client-sdk
v1.0.3
Published
Site-agnostic AI voice agent SDK for React apps
Downloads
38
Maintainers
Readme
voice-client-sdk
Site-agnostic AI voice agent SDK for React apps (client-side).
This SDK scans actionable DOM elements, listens to voice (Web Speech API), sends transcript + DOM snapshot to your backend /intent endpoint, and executes the returned action safely.
Install
npm i voice-client-sdkUsage (React)
import React from "react";
import { useVoiceAgent, VoiceAgentOverlay } from "react-ai-voice-agent-sdk";
export default function App() {
const { agent, state } = useVoiceAgent({
intentEndpoint: "http://localhost:4000/intent",
wakeWord: "hey assistant",
permissions: {
allowNavigation: false,
requireConfirmFor: ["delete", "logout", "pay", "checkout"],
},
});
return (
<>
<YourApp />
<VoiceAgentOverlay agent={agent} state={state} />
</>
);
}Backend contract
POST /intent
{
"text": "hey assistant click login",
"domSnapshot": [
{ "id": "el-1", "role": "button", "label": "Login", "selector": "#login" }
]
}Returns:
{
"action": "click",
"targetId": "el-1",
"value": null,
"confidence": 0.72
}