new TeleQuickClient(...)
| Argument | Description |
|---|---|
endpoint | quic://host:port (Node) or https://host:port (browser). The SDK rewrites quic:// → https:// for WT. |
credentialsPathOrToken | In Node, the path to your service-account JSON. In the browser, the JWT itself. |
isBrowserToken | true ⇒ second arg is a token. false ⇒ second arg is a file path. |
serverCertificateHash | Base64-encoded SHA-256 fingerprint for self-signed dev certs. |
credentialsPathOrToken is omitted, the SDK reads from TELEQUICK_CREDENTIALS.
await client.connect()
Initializes the WASM module, signs the JWT (Node-only; browsers pass tokens
through), opens the WebTransport session, and subscribes to events under a
fresh per-instance UUID.
connect() is called automatically by every RPC method, so you don’t have
to call it explicitly — but doing so reduces first-RPC latency.
RPC methods
await client.dial(options)
onDisconnect requires a callSid — the SDK uses it to route the matching
hangup event back to your callback.
await client.originateBulk(options)
cps sets both calls_per_second and max_concurrent_calls to the same
value for simplicity. For different values, build the request through
wasmModule.BulkRequest directly.
await client.terminate(callSid)
Hang up a single call.
await client.barge(callSid)
Trigger or arm AI barge-in for callSid. While the AI agent is speaking,
the gateway gates the AI’s outbound audio the moment the human starts
talking on the inbound leg. Not the supervisor-injection feature
found in legacy PBXs. See Method IDs → Barge.
await client.streamEvents(clientId)
Re-subscribe events under a different clientId. connect() already does
this for you with the auto-generated UUID; only use this for explicit fanout.
Inbound-routing RPCs
Mid-call control (ExecuteDialplan verbs)
await client.pushAudio(callSid, payload, codec, seq, eos)
endOfStream = true is final — you can’t push more frames after.
Callbacks
[length][method_id]
prefix). Use the WASM helpers (exposed on client.wasmModule) to decode.
Direct WASM access
If you need a method that isn’t wrapped, the WASM module is exposed onclient.wasmModule after connect(). It’s typed as TeleQuickWasmModule
and lets you build any envelope:
req.delete() is mandatory — Emscripten doesn’t reclaim WASM heap
automatically. Forgetting it leaks memory at the rate of one struct per call.