@zentiq/client
v0.2.0
Published
Official browser SDK for Zentiq AI avatars: connect a session token, render the live avatar into an element, and receive transcript/speaking events.
Maintainers
Readme
@zentiq/client
Official browser SDK for Zentiq AI avatars. Connect a session token, render the live avatar into an element, talk to it, and receive transcript + speaking events. Wraps the WebRTC transport so you don't hand-wire it.
npm install @zentiq/client livekit-clientimport { startSession } from "@zentiq/client";
// 1) your backend mints a token with @zentiq/node (API key stays server-side)
const { sessionToken, url } = await fetch("/api/zentiq-token", { method: "POST" }).then((r) => r.json());
// 2) go live
const session = await startSession({
token: sessionToken,
url,
video: document.querySelector<HTMLVideoElement>("#avatar")!,
onReady: () => console.log("live"),
onTranscript: (t) => console.log(t.role, t.text, t.final),
onSpeaking: (who) => (badge.textContent = who), // "avatar" | "user" | "none"
onEnd: () => console.log("ended"),
});
// controls
await session.setMicrophoneEnabled(false);
session.end();startSession attaches only the synced avatar audio+video (it ignores the internal transport track),
enables the mic, and surfaces live captions on the data channel. livekit-client is a peer dependency.
