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 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

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.

Which id you need

ComponentIdWhere to find it
Floating launcher (LauncherProvider)companyId, your workspace idCustomer Support → Floating Launcher, the data-company-id in the Install box
Support chat (SupportProvider)widgetIdCustomer 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

import AsyncStorage from '@react-native-async-storage/async-storage';
import { LauncherProvider, SupportLauncher } from '@clientsphere/support-native';
 
export function App({ user }) {
  return (
    <LauncherProvider
      baseUrl="https://clientsphere.io"
      companyId="your-workspace-id"
      storage={AsyncStorage}
      identity={user ? { email: user.email, name: user.name } : null}
    >
      <YourNavigator />
      <SupportLauncher />
    </LauncherProvider>
  );
}

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

import AsyncStorage from '@react-native-async-storage/async-storage';
import { SupportProvider, SupportChatScreen } from '@clientsphere/support-native';
 
export function SupportScreen({ user }) {
  return (
    <SupportProvider
      baseUrl="https://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