@typewise/chat-sdk) gives you everything the chat
widget does, without the UI. You decide how the conversation looks and where it
lives: a product page, a help sidebar, a command palette, a native app, or a
terminal.
Get started with React
Build a working chat in about 50 lines
Live examples
Try a storefront concierge, a docs sidebar, and more
What the SDK handles
You write the rendering. The SDK takes care of the rest:Sessions
A returning visitor picks up their open conversation
Real-time replies
AI Agent and Human Agent messages, with typing indicators
Delivery state
Messages still sending or failed, without duplicates
Context and identity
Page context variables and signed, verified values
Attachments
Uploads, downloads, and upload progress
Surveys and verification
Satisfaction ratings and email verification codes
Choose between the widget and the SDK
Use the chat widget
- Ready-made bubble and full-page chat
- One script tag and
window.twConfig - Branding options in the platform
window.twSdkto set variables and open the chat
Use the Chat SDK
- You build the UI with your own components
npm installor a script tag- Runs in any JavaScript runtime, not only websites
- Full state and events, so chat and page react to each other
How it works
1
Create one client
createClient({clientId}) returns a client for one visitor. It does no
network work until you call a method, so it’s safe during
server-side rendering.2
Subscribe to state
chat.subscribe(listener) calls you after every change with an immutable
snapshot: messages, activity, connection, and the open conversation. Render
from that snapshot.3
Resume and send
chat.resume() restores the visitor’s open conversation, if any.
chat.sendMessage(text) starts a conversation when none is open.Prerequisites
- Your client ID. Find it under Behavior → Channels → Chat →
Installation, as
clientIdin the Quick start snippet. - If your chat has a Domain allowlist, add every origin that runs the SDK,
including
localhostfor development. While the list is empty, every origin is allowed. - Declare the context variables you plan to send in Context Variables. Typewise drops names you haven’t declared.
Next steps
Get started with React
Install the SDK and build your first chat
Plain HTML and JavaScript
Load the SDK from a script tag, no build step
Other frameworks
Vue, Svelte, Next.js, React Native, and Node
API reference
Every method, option, event, and error