React Native SDK
The floating launcher and support chat in a React Native app with the native SDK, no WebView.
The web embeds are script tags that render into a page. A mobile app has no
page, so it uses @clientsphere/support-native instead. The package covers
both embeds:
- The floating launcher: a pill that opens an Intercom-style sheet holding everything at once, a live conversation, the knowledge base, a message that becomes a ticket, and a suggestion form. Configured under Customer Support → Floating Launcher. Most apps want this one.
- Support chat: a live conversation with agents and the AI assistant, the mobile counterpart of the Support Hub. Configured under Customer Support → Support Hub. The rest of this page and the hooks, chat screen and lifecycle pages describe it.
It talks to your workspace directly. There is nothing to configure server-side beyond the widget you already have, and a visitor who chats on your site and in your app is one contact in the CRM as long as you identify them by email in both places.
Install
react and react-native are peer dependencies. To keep the visitor id across
launches, also install a storage library such as
@react-native-async-storage/async-storage; the SDK accepts anything with
getItem and setItem.
Which id you need
| Component | Id | Where to find it |
|---|---|---|
Floating launcher (LauncherProvider) | companyId, your workspace id | Customer Support → Floating Launcher, the data-company-id in the Install box |
Support chat (SupportProvider) | widgetId | Customer Support → Support Hub, the data-widget-id in the Install box |
The launcher also accepts widgetId in place of companyId, the same way the
web snippet lets you swap data-company-id for data-widget-id.
Minimal app: floating launcher
A pill appears in the corner; tapping it opens the sheet with your configured menu. The Floating launcher page covers the props and each screen of the sheet.
Minimal app: support chat
That is a working support chat. The provider fetches the widget config, opens a session, connects the socket, keeps a heartbeat going, and rebuilds all of it when the app returns from the background. The screen shows history, sends messages, streams AI replies, shows agent typing, offers "Talk to a human", and handles the email gate when the widget requires one.
Pass storage. Without it the visitor id lives in memory and every launch
starts a new visitor, which means no conversation history.
What is in the package
| Layer | Exports | Depends on |
|---|---|---|
| Core | SupportClient, SupportRealtime, LauncherClient, StorageAdapter, types | socket.io-client for chat only |
| React | SupportProvider and its hooks; LauncherProvider, useLauncher | react, react-native |
| UI | SupportChatScreen, SupportLauncher | the React layer |
Use the screen as is, build your own on the hooks, or use the core client without React at all.
Pages
Floating launcher
The pill and sheet: knowledge base, send a message, suggest an improvement.
Identity and sessions
Who the visitor is, the email gate, and what is persisted between launches.
Hooks
useConversation, useConversations and useSupportConfig, field by field.
Chat screen
SupportChatScreen props, attachments, and building your own.
Lifecycle and limits
Background and foreground, reconnects, errors, rate limits, and what the SDK does not do.