Bouw voice agents
in TypeScript
Een TypeScript-SDK, ondertekende webhooks en een gedocumenteerde REST API. Gemaakt door developers, voor developers.
npm install hmsovereign
# or
pnpm add hmsovereign
# or
bun add hmsovereignVijf minuten van install tot eerste gesprek
Installeer de SDK
Voeg het hmsovereign-package toe aan je project.
npm install hmsovereign
# or
pnpm add hmsovereign
# or
bun add hmsovereignInitialiseer de client
Gebruik je organisatie API-key uit het dashboard.
import { HMSSovereign } from "hmsovereign"
const client = new HMSSovereign({
apiKey: process.env.VOICEDOCK_API_KEY!,
})
// List existing assistants
const assistants = await client.assistants.list()
console.log(`You have ${assistants.length} assistants`)Maak je eerste assistant
Configureer provider, stem en system prompt.
const assistant = await client.assistants.create({
name: "Customer Support",
first_message: "Hi, how can I help you today?",
llm_config: {
provider: "openai",
model: "gpt-5.4-mini",
messages: [
{
role: "system",
content: `You are a helpful support agent
for an e-commerce store. Be concise.`,
},
],
},
stt_config: {
provider: "deepgram",
model: "nova-3-general",
language: "nl",
},
tts_config: {
provider: "elevenlabs",
voice_id: "ukiwGs47sHyibruHJ1vg",
},
})Start een gesprek
Trigger een uitgaand gesprek of accepteer een inkomende.
// Outbound call
const call = await client.calls.create({
destination: "+31612345678",
assistant_id: assistant.id,
})
// Status updates arrive on your webhook
console.log(call.call_id)Endpoints die je echt zult gebruiken
Een kleine, gefocuste API. Geen abstracties om tegen te vechten.
/api/v1/assistantsList your assistants/api/v1/assistantsCreate a new assistant configuration/api/v1/calls/outboundInitiate an outbound call/api/v1/calls/{id}Fetch call details and transcripts/api/v1/numbersList your phone numbersSubscribe op wat ertoe doet
Beantwoord tool calls, volg de gespreksstatus en ontvang na afloop het volledige transcript, allemaal via één ondertekend webhook-kanaal.
assistant-requestIncoming call — return the assistant config to handle it
status-updateCall lifecycle updates (in-progress, ended, ended-with-error)
tool-callsAssistant invoked a tool — your handler runs here
end-of-call-reportFinal transcript, recording URL, analysis on hangup
Klaar om te beginnen?
Lees de volledige docs of grab de SDK van npm.