ClientSphereDocs

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 with the knowledge base, a "send us a message" form 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

npm install @clientsphere/support-native socket.io-client

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.

Find the widget id under Customer Support → Support Hub. It is the same id the web embed uses.

Minimal app

import AsyncStorage from '@react-native-async-storage/async-storage';
import { SupportProvider, SupportChatScreen } from '@clientsphere/support-native';
 
export function SupportScreen({ user }) {
  return (
    <SupportProvider
      baseUrl="https://your-workspace.clientsphere.io"
      widgetId="your-widget-id"
      storage={AsyncStorage}
      identity={user ? { email: user.email, name: user.name, userId: user.id } : undefined}
    >
      <SupportChatScreen />
    </SupportProvider>
  );
}

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

LayerExportsDepends on
CoreSupportClient, SupportRealtime, LauncherClient, StorageAdapter, typessocket.io-client for chat only
ReactSupportProvider and its hooks; LauncherProvider, useLauncherreact, react-native
UISupportChatScreen, SupportLauncherthe React layer

Use the screen as is, build your own on the hooks, or use the core client without React at all.

Pages

On this page