Developer documentatie
Bouw voice agents
in TypeScript
First-class TypeScript SDK. Streaming events. Webhook signatures. Gemaakt door developers, voor developers.
terminal
npm install hmsovereign
# or
pnpm add hmsovereign
# or
bun add hmsovereignQuickstart
Vijf minuten van install tot eerste gesprek
01
Installeer de SDK
Voeg het hmsovereign-package toe aan je project.
terminal
npm install hmsovereign
# or
pnpm add hmsovereign
# or
bun add hmsovereign02
Initialiseer de client
Gebruik je organisatie API-key uit het dashboard.
index.ts
import { HMSSovereign } from "hmsovereign"
const client = new HMSSovereign({
apiKey: process.env.HMS_API_KEY, // fl_live_...
})
// List existing assistants
const assistants = await client.assistants.list()
console.log(`You have ${assistants.length} assistants`)03
Maak je eerste assistant
Configureer provider, stem en system prompt.
assistant.ts
const assistant = await client.assistants.create({
name: "Customer Support",
model: {
provider: "openai",
model: "gpt-4o-mini",
systemPrompt: `You are a helpful support agent
for an e-commerce store. Be concise.`,
},
voice: {
provider: "elevenlabs",
voiceId: "21m00Tcm4TlvDq8ikWAM",
},
transcriber: {
provider: "deepgram",
model: "nova-3",
language: "nl",
},
})04
Start een gesprek
Trigger een uitgaand gesprek of accepteer een inkomende.
call.ts
// Outbound call
const call = await client.calls.create({
assistantId: assistant.id,
customer: {
number: "+31612345678",
},
phoneNumberId: "phn_8821",
})
// Fetch call details later
const details = await client.calls.get(call.id)
console.log(details.status)API surface
Endpoints die je echt zult gebruiken
Een kleine, gefocuste API. Geen abstracties om tegen te vechten.
GET
/v1/assistantsList your assistantsPOST
/v1/assistantsCreate a new assistant configurationPOST
/v1/callsInitiate an outbound callGET
/v1/calls/{id}Fetch call details and transcriptsGET
/v1/phone-numbersList provisioned phone numbersRealtime events
Subscribe op wat ertoe doet
Stream transcripten, intercept tool calls, reageer op call status — allemaal over één webhook-kanaal.
assistant-requestIncoming call — return the assistant config to handle it
status-updateCall lifecycle updates (ringing, in-progress, ended)
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.
Fully typed
OpenAPI spec
Zero config