Native React Native SDK for embedding Conferbot chatbots into iOS and Android applications -- no WebView required.
- Native Components -- Built entirely with React Native views, not a WebView wrapper
- Real-time Messaging -- Socket.IO-based communication with automatic reconnection
- Offline Support -- Messages are queued locally and sent when connectivity returns
- Push Notifications -- Register device tokens for background message delivery
- Live Agent Handover -- Seamless transition between bot and human agents
- Message Reactions -- Users can react to messages with emoji
- Read Receipts -- Delivery and read status indicators on messages
- Knowledge Base -- Surface help articles directly in the chat interface
- Analytics -- Built-in event tracking for sessions, messages, and user behavior
- Theming -- Light and dark themes out of the box, fully customizable
- Session Persistence -- Conversations survive app restarts via AsyncStorage
- File Uploads -- Attach images and documents from the device
- TypeScript -- Complete type definitions for every export
| Dependency | Minimum Version |
|---|---|
| React | 17.0.0 |
| React Native | 0.70.0 |
| iOS | 12.0+ |
| Android | API 21+ |
npm install @conferbot/react-native
# or
yarn add @conferbot/react-nativenpm install react react-native @react-native-async-storage/async-storage@react-native-async-storage/async-storage is optional but required for session persistence and offline queue features.
You need two credentials to use the SDK:
- Log in to Conferbot Dashboard
- Create or select a bot from the dashboard
- Find your Bot ID: Go to Bot Settings > General -- the Bot ID is displayed at the top
- Find your API Key: Go to Workspace Settings > API Keys -- copy the key starting with
conf_
Note: For development and testing, you can use the example app's built-in test credentials. For production, always use your own API key and bot ID.
The fastest path -- renders a complete chat UI with a single component.
import React from 'react';
import { ConferBotProvider, ChatWidget } from '@conferbot/react-native';
export default function App() {
return (
<ConferBotProvider apiKey="YOUR_API_KEY" botId="YOUR_BOT_ID">
<ChatWidget />
</ConferBotProvider>
);
}A floating action button that overlays on top of your app. Tapping it opens the chat in a bottom sheet. Supports server-driven customization (colors, icon, CTA tooltip, position).
import React from 'react';
import { View, Text } from 'react-native';
import { ConferBotProvider, ConferBotWidget } from '@conferbot/react-native';
export default function App() {
return (
<ConferBotProvider apiKey="YOUR_API_KEY" botId="YOUR_BOT_ID">
<View style={{ flex: 1 }}>
<Text>Your App Content</Text>
<ConferBotWidget />
</View>
</ConferBotProvider>
);
}The widget reads server customizations automatically -- FAB color, icon, size, position, CTA text, and border radius are all configurable from the Conferbot dashboard.
Full control over the UI -- the hook manages connection state, messages, and actions.
import React from 'react';
import { View, Text, Button, FlatList } from 'react-native';
import { ConferBotProvider, useConferBot } from '@conferbot/react-native';
function ChatScreen() {
const { openChat, sendMessage, record, isConnected } = useConferBot();
return (
<View style={{ flex: 1 }}>
<Text>{isConnected ? 'Connected' : 'Connecting...'}</Text>
<FlatList
data={record}
keyExtractor={(item, i) => String(i)}
renderItem={({ item }) => <Text>{item.text}</Text>}
/>
<Button title="Send Hello" onPress={() => sendMessage('Hello!')} />
</View>
);
}
export default function App() {
return (
<ConferBotProvider apiKey="YOUR_API_KEY" botId="YOUR_BOT_ID">
<ChatScreen />
</ConferBotProvider>
);
}Use pre-built components alongside your own custom UI.
import React from 'react';
import { View } from 'react-native';
import {
ConferBotProvider,
useConferBot,
MessageList,
ChatInput,
ChatHeader,
ConnectionStatus,
} from '@conferbot/react-native';
function CustomChat() {
const { record, sendMessage, currentAgent } = useConferBot();
return (
<View style={{ flex: 1 }}>
<ChatHeader />
<ConnectionStatus />
<MessageList messages={record} />
<ChatInput onSend={sendMessage} />
</View>
);
}
export default function App() {
return (
<ConferBotProvider apiKey="YOUR_API_KEY" botId="YOUR_BOT_ID">
<CustomChat />
</ConferBotProvider>
);
}Pass a config prop to ConferBotProvider to control SDK behavior.
<ConferBotProvider
apiKey="YOUR_API_KEY"
botId="YOUR_BOT_ID"
config={{
enableNotifications: true,
enableOfflineMode: true,
enablePersistence: true,
enableReadReceipts: true,
autoConnect: true,
reconnectionAttempts: 5,
reconnectionDelay: 3000,
}}
>
{children}
</ConferBotProvider>| Option | Type | Default | Description |
|---|---|---|---|
enableNotifications |
boolean | false | Enable push notification support |
enableOfflineMode |
boolean | false | Queue messages when offline |
enablePersistence |
boolean | false | Persist sessions across app restarts |
enableReadReceipts |
boolean | true | Show message delivery/read indicators |
autoConnect |
boolean | true | Connect to socket on mount |
reconnectionAttempts |
number | 5 | Max reconnection attempts |
reconnectionDelay |
number | 3000 | Delay between reconnection attempts (ms) |
Pass a customization prop to style the built-in UI components.
<ConferBotProvider
apiKey="YOUR_API_KEY"
botId="YOUR_BOT_ID"
customization={{
primaryColor: '#4F46E5',
fontFamily: 'Inter',
headerTitle: 'Support',
bubbleRadius: 12,
enableAvatar: true,
avatarUrl: 'https://example.com/avatar.png',
botBubbleColor: '#F3F4F6',
userBubbleColor: '#4F46E5',
}}
>
{children}
</ConferBotProvider>Identify users so conversations persist across sessions and devices.
<ConferBotProvider
apiKey="YOUR_API_KEY"
botId="YOUR_BOT_ID"
user={{
id: 'user_123',
name: 'Jane Doe',
email: 'jane@example.com',
}}
>
{children}
</ConferBotProvider>The SDK ships with light and dark themes. Wrap your app in ThemeProvider to apply one globally or provide a custom theme.
import { ThemeProvider, darkTheme } from '@conferbot/react-native';
export default function App() {
return (
<ThemeProvider theme={darkTheme}>
<ConferBotProvider apiKey="YOUR_API_KEY" botId="YOUR_BOT_ID">
<ChatWidget />
</ConferBotProvider>
</ThemeProvider>
);
}To customize further, spread a base theme and override specific tokens:
import { defaultTheme } from '@conferbot/react-native';
const customTheme = {
...defaultTheme,
colors: {
...defaultTheme.colors,
primary: '#4F46E5',
},
};Register a device push token (from Firebase, APNs, or Expo) to receive messages when the app is backgrounded.
const { registerPushToken } = useConferBot();
// After obtaining a token from your push notification provider:
await registerPushToken(deviceToken);When enableOfflineMode is set, outbound messages are queued locally and flushed automatically once connectivity is restored. Use the useOfflineQueue and useNetworkStatus hooks for fine-grained control.
import { useOfflineQueue, useNetworkStatus } from '@conferbot/react-native';
const { isOnline } = useNetworkStatus();
const { pendingCount, flush } = useOfflineQueue();Users can react to any message with emoji. The useReactions hook and the ReactionPicker / MessageReactions components handle state and rendering.
import { useReactions, ReactionPicker } from '@conferbot/react-native';
const { addReaction, removeReaction } = useReactions();Message status indicators (sent, delivered, read) update in real time. Enable via config.enableReadReceipts and use the useReadReceipts hook or MessageStatusIndicator component.
Surface help articles inside the chat interface. The KnowledgeBase component connects to your Conferbot knowledge base and lets users search and browse articles without leaving the conversation.
Track session metrics, message counts, drop-off points, and custom events. Wrap your provider with ConferBotWithAnalyticsProvider or use the useAnalytics hook directly.
import { ConferBotWithAnalyticsProvider } from '@conferbot/react-native';
<ConferBotWithAnalyticsProvider apiKey="YOUR_API_KEY" botId="YOUR_BOT_ID">
<ChatWidget />
</ConferBotWithAnalyticsProvider>const { trackEvent } = useAnalytics();
trackEvent('custom_action', { screen: 'checkout' });Subscribe to real-time events for advanced use cases.
import { useConferBot } from '@conferbot/react-native';
const { on } = useConferBot();
useEffect(() => {
const unsubscribe = on('bot_response', (data) => {
console.log('Bot responded:', data);
});
return unsubscribe;
}, []);Key events: bot_response, agent_message, agent_accepted, agent_left, agent_typing_status, chat_ended, connection_error.
For the complete API surface -- every component prop, hook return value, and type definition -- see the docs/ directory:
- API.md -- Full API reference
- COMPONENTS.md -- Component catalog
- COMPONENT_ARCHITECTURE.md -- Component design patterns
- ARCHITECTURE.md -- SDK architecture overview
- EXAMPLES.md -- Additional code examples
A fully working example app is included in the example/ directory. It demonstrates all three integration patterns with a tab-based UI.
# 1. Clone the repo
git clone https://github.com/conferbot/react-native-sdk.git
cd react-native-sdk
# 2. Install SDK dependencies
npm install
# 3. Set up the example app
cd example
npm install
# 4. Configure your bot credentials
# Open example/App.tsx and replace:
# const API_KEY = 'test_key';
# const BOT_ID = '69e8503cf33718a92ea792fe';
# with your own API key and Bot ID from the Conferbot dashboard.
# 5. (Optional) Point to production server
# Remove or update the ConferBotEndpoints.configure() block in App.tsx.
# By default, the SDK connects to https://embed.conferbot.com
# 6. Run on Android
npx react-native run-android
# 7. Or run on iOS
cd ios && pod install && cd ..
npx react-native run-ios| Tab | Pattern | Description |
|---|---|---|
| Widget | Drop-in | Full chat UI opens in a modal -- one component, zero config |
| Headless | Hook-based | Custom UI with useConferBot() hook for full control |
| Custom | Mix & match | Pre-built components (MessageList, ChatInput) in a custom layout |
npm install # Install dependencies
npm run build # Compile TypeScript
npm run watch # Watch mode
npm run lint # Run ESLint
npm run type-check # Type check without emitting
npm test # Run tests
npm run test:coverage # Tests with coverage reportContributions are welcome. Please open an issue first to discuss what you would like to change, then submit a pull request.
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-change) - Commit your changes
- Push to your fork and open a pull request
Apache 2.0 -- see LICENSE for details.


