Add live chat support to your React Native app with the HelpLane SDK.
- React Native 0.60+
- react-native-webview 11.0+
npm install @helplane/react-native react-native-webview
# or
yarn add @helplane/react-native react-native-webviewcd ios && pod installimport { HelpLaneProvider } from '@helplane/react-native';
export default function App() {
return (
<HelpLaneProvider brandToken="your-brand-token">
<YourApp />
</HelpLaneProvider>
);
}import { useHelpLane } from '@helplane/react-native';
function ProfileScreen() {
const { identify } = useHelpLane();
useEffect(() => {
identify({
id: 'user-123',
name: 'John Doe',
email: '[email protected]',
});
}, []);
return <View>...</View>;
}import { HelpLaneChat, useHelpLane } from '@helplane/react-native';
// Option 1: Use the chat component directly
function SupportScreen() {
return <HelpLaneChat style={{ flex: 1 }} />;
}
// Option 2: Use the hook to control visibility
function App() {
const { openChat } = useHelpLane();
return (
<Button title="Get Help" onPress={openChat} />
);
}HelpLane uses OneSignal for push notifications:
import { HelpLanePush } from '@helplane/react-native';
import OneSignal from 'react-native-onesignal';
// After OneSignal setup
HelpLanePush.register();
// Handle notification tap
OneSignal.setNotificationOpenedHandler((event) => {
if (HelpLanePush.isHelpLaneNotification(event.notification)) {
// Navigate to chat screen
navigation.navigate('Support');
}
});<HelpLaneProvider
brandToken="your-brand-token"
baseURL="https://your-instance.helplane.io" // Optional
user={{ // Optional: pre-set user
id: 'user-123',
name: 'John Doe',
}}
>
<App />
</HelpLaneProvider>| Prop | Type | Required | Description |
|---|---|---|---|
brandToken |
string | Yes | Your HelpLane brand token |
baseURL |
string | No | Custom instance URL |
user |
HelpLaneUser | No | Pre-identified user |
children |
ReactNode | Yes | Your app components |
const {
identify, // (user: HelpLaneUser) => void
clearUser, // () => void
openChat, // () => void
closeChat, // () => void
isOpen, // boolean
} = useHelpLane();| Prop | Type | Description |
|---|---|---|
style |
ViewStyle | Container style |
onLoad |
() => void | Called when chat loads |
onError |
(error) => void | Called on error |
| Property | Type | Description |
|---|---|---|
id |
string | Unique user identifier |
name |
string | Display name |
email |
string | Email address |
avatarURL |
string | Profile image URL |
customAttributes |
object | Custom data |
Full TypeScript support is included. Import types:
import type { HelpLaneUser, HelpLaneConfig } from '@helplane/react-native';- Issues: GitHub Issues
MIT License - see LICENSE for details.