Skip to main content
@sagepilot-ai/react-native-sdk opens the Sagepilot-hosted chat experience inside a React Native WebView and provides APIs for setup, identity, unread count, attachments, and app-owned launchers.

Requirements

  • React 18+
  • React Native 0.72+
  • react-native-webview 13+
  • A Sagepilot workspace ID and chat channel ID
  • Secure token storage for production apps

Install

npm install @sagepilot-ai/react-native-sdk@latest react-native-webview
For secure persisted sessions, install one storage library:
npm install react-native-keychain
Expo apps can use expo-secure-store instead:
npx expo install expo-secure-store
The base SDK does not bundle Android CameraX. Install @sagepilot-ai/react-native-camera-addon only if your Android app needs Sagepilot’s in-app CameraX picker.

Start here

Install the SDK

Add the SDK, WebView dependency, and secure storage package.

Configure chat

Set the workspace/channel key, presentation behavior, and launcher theme.

Handle attachments

Use the optional CameraX addon or app-provided native pickers for more reliable uploads.

Enable push notifications

Connect Sagepilot message webhooks to your app-owned push system.

Open chat

Use hooks and public methods to connect chat to your app-owned UI.

Runtime model

SagepilotChatProvider renders the Sagepilot-hosted chat UI in a React Native WebView. Most apps do not need a host override. For standard Sagepilot cloud usage, omit host; the SDK connects to Sagepilot-hosted endpoints automatically. Set host only when Sagepilot provides a dedicated endpoint for your workspace.