October 30, 2026
Web SDK 2.0 — a redesigned widget, a built-in launcher button, an accent color, a token function in init, simpler microphone handling, and accessibility improvements
Web SDK 2.0 is out. It redesigns the agent widget and changes how you start the SDK.
2.0 has breaking changes. init now takes a function that returns a token, and the config is reorganized. See Upgrading to Web SDK 2.0. To stay on 1.x for now, pin @touchcastllc/[email protected].
A redesigned widget
The widget has a new look, with new controls and new loading, microphone, and inactivity cards. Set style.accentColor to put your brand color on the microphone button, the buttons on the widget's cards, and the loading ring:
NapsterCompanionApiSdk.init(getToken, {
style: { view: "round", accentColor: "#0091ff" },
});See Accent color.
A built-in launcher button
The SDK can now show its own launcher button, so visitors start the agent when they're ready. The launcher comes back when the session ends. You can also point it at a button you already have on the page.
NapsterCompanionApiSdk.init(getToken, {
button: { enabled: true, label: "Talk to an agent" },
});Without button, the session still starts as soon as you call init. See Start on click.
A token function instead of a token
init now takes a function that fetches a token from your backend. The SDK calls it once the visitor has allowed the microphone, right before it connects, so the token can't expire while the visitor decides.
NapsterCompanionApiSdk.init(async () => {
const response = await fetch("/api/avatar-session", { method: "POST" });
return (await response.json()).token;
});See Initialization.
Simpler microphone handling
The microphone card is simpler. While the browser's prompt is open, the card tells the visitor to click Allow. If they block the microphone, the card asks them to allow it in the browser's site settings, with a Check again button, instead of walking through browser-specific steps.
If the microphone stops working during a session, a warning badge now appears on the mute button. Clicking it asks for the microphone again, or shows the same card if the browser has blocked it.
A new inactivity card
Before an idle session ends, the widget now shows a Still there? card with an I'm here button. While it shows, the microphone is held silent and commands you send are dropped. Clicking I'm here sends an "I'm here" user message, which appears in the transcript and in onData. The countdown of the SDK's inactivity timeout is now at least 20 seconds. See Inactivity timeout.
Accessibility improvements
The widget has better screen reader support, labelled controls, keyboard navigation, and layouts that hold up on small screens and at high zoom.
Session status
A new onSessionStatusChange callback reports each stage of the session, from waiting for the microphone to live video. See Session status.
Fixes
DataChannelMessageType.FUNCTION_CALL_OUTPUTnow sendssend_function_output, so function results sent with it reach the agent.- A second
initcall while a session is running is rejected without ending that session. - The SDK's styles no longer leak into the rest of your page.
- The microphone is released when a session ends.
- Restarting a session quickly no longer loses the microphone or shows a false "blocked" card.
- When the organization runs out of credits, the session ends cleanly and
onErrorreports it. - On iOS Safari, the volume button now mutes the avatar.
- The console warns when an inline container is too small for the controls.