Install
Usage
- Text chat
- Streaming chat
- Voice
The
<KioskChat> component renders a fully-featured chat UI in a single line. Drop it
anywhere in your component tree.<KioskChat> props
Device credential token,
hk_live_… (production) or hk_test_… (sandbox — see
Sandbox mode). Pass via an environment variable — never
hardcode in production client bundles.Advanced topics
Next.js usage
Next.js usage
Both Do not instantiate
<KioskChat> and <KioskVoice> are client components — they use browser APIs
(WebSocket, WebRTC, navigator.mediaDevices) and cannot run during SSR.Add "use client" to any file that imports them:HumainKioskClient at module scope in a Server Component — the
client constructor accesses window and will throw during server render. Instantiate it
inside a useEffect or inside a Client Component.For credentials in Next.js, use NEXT_PUBLIC_HUMAIN_CREDENTIAL for client-side usage
(sandbox only) or proxy calls through an API route to keep live credentials server-side.