@humain/kiosk-js SDK wraps the Humain Device API so you can open sessions, send messages, and
stream responses with one import and a handful of method calls — no raw HTTP required.
1
Install the package
2
Open a session and send a message
hk_test_ credential. See Sandbox mode.3
Add streaming
Replace The iterator yields objects of these types:
sendMessage with session.stream() to receive tokens as they are generated.
This uses an async iterator — for await works in any modern JavaScript runtime.The underlying WebSocket delivers one complete response per turn — see
WebSocket streaming for the wire protocol.
chunk,
tool_call, and tool_result events are a client-side reveal built by the SDK on top of
that single response, not genuine incremental delivery from the network.4
Handle errors
The client throws typed
KioskError instances you can inspect:What’s next?
Drop-in widget
Add a floating chat button to any webpage with a single
<script> tag — no build step.React components
<KioskChat> and useKioskSession for React and Next.js applications.Streaming UI patterns
Cursor animation, layout shift prevention, and abort/retry patterns.