Installation
Required Peer Dependencies
Install the following dependencies in your Expo project:Compatibility
| Requirement | Version |
|---|---|
| Expo SDK | 54+ |
| React Native | 0.81+ |
| React | 19+ |
| iOS | 13.4+ |
| Android API | 23+ |
This SDK requires the New Architecture to be enabled.
Quick Start
The SDK exports two components: a Provider and a Screen. Wrap your app with the provider, then render the chat screen wherever you need it.API Reference
SyngentaAssistantProvider
Context provider that configures the SDK. Must wrap any screen that rendersSyngentaChatScreen.
Authentication token for API access
Custom API server URL. Defaults to the staging server.
Child components
SyngentaChatScreen
A complete chat interface component. Renders a full-screen chat experience with no configuration required.Message List
Automatic scrolling and history loading
Text Input
Text input with send button
Image Picker
Camera and gallery support
Voice Recording
Gesture-controlled audio recording
Connection Status
Real-time connection indicators
Theming
Dark and light mode support
Integration Examples
- Expo Router
- Conditional
Features
Text Messages
Text Messages
Type messages using the text input at the bottom of the screen. Press the send button or use the keyboard return key to send.
Image Messages
Image Messages
Tap the image button to:
- Take a photo with the camera
- Select an image from the gallery
Voice Messages
Voice Messages
Press and hold the microphone button to record a voice message:
- Hold to start recording
- Release to send the recording
- Slide left while holding to cancel
The minimum recording duration is 750ms. Shorter recordings are automatically cancelled.
Connection Status
Connection Status
A banner appears at the top of the chat when:
| Status | Meaning |
|---|---|
| Connecting | Establishing connection to server |
| Disconnected | Connection lost, will retry automatically |
| Loading Previous Messages | Fetching message history |
| Error | Connection failed |
Theming
Theming
The chat interface automatically adapts to the system appearance:
- Light mode: Beige background with green sent messages
- Dark mode: Dark background with teal sent messages
Permissions
Configure the following permissions in yourapp.json for full functionality:
Troubleshooting
useSyngentaAssistant must be used within SyngentaAssistantProvider
useSyngentaAssistant must be used within SyngentaAssistantProvider
The
SyngentaChatScreen must be rendered inside a SyngentaAssistantProvider:Correct - Wrap with provider:
Chat not connecting
Chat not connecting
Voice recording not working
Voice recording not working
Images not sending
Images not sending
Reanimated/Gesture Handler errors
Reanimated/Gesture Handler errors
TypeScript errors
TypeScript errors
Ensure your TypeScript version is compatible and that you have the latest type definitions:
