@usecrow/react-native package adds Crow to any React Native app. Drop in <CrowWidget /> for a ready-made floating chat button and bottom sheet, or use the useChat hook to build a fully custom interface.
Installation
Quick Start
Drop-in widget (fastest)
Add<CrowWidget /> inside your <CrowProvider> for a floating chat button and bottom sheet — zero UI work required:
CrowWidget renders a floating action button that opens a slide-up chat sheet. It handles messages, streaming, conversation history, and user auth out of the box.
Custom UI (headless)
UseuseChat to build your own interface:
CrowProvider Props
| Prop | Required | Description |
|---|---|---|
productId | Yes | Your product ID from the dashboard |
apiUrl | No | API URL (defaults to https://api.usecrow.org) |
storage | No | Storage adapter for persistence. Defaults to in-memory |
identityToken | No | JWT token for authenticated users |
userName | No | Display name for identified users |
model | No | Default model to use |
useChat Hook
The main hook for chat functionality:Message Type
Event Callbacks
Conversation Persistence
By default, conversations are lost when the app closes. UsecreateAsyncStorageAdapter for persistence:
The storage adapter must preload data before the provider mounts. Call
preloadForProduct() during your app’s initialization phase.useConversations Hook
Manage conversation history for authenticated users:Conversation history requires an authenticated user. Call
identify() with a valid JWT token first.User Identity
Identify users to enable conversation history and personalized responses:Client-Side Tools
Register tools that run natively in your app:Page Context
Send app state with messages so the agent knows context:Full Example
Differences from Web SDK
Web (@usecrow/ui) | React Native (@usecrow/react-native) | |
|---|---|---|
| UI | Pre-built widget/copilot | You build your own native UI |
| Streaming | Automatic | Handled internally by SDK |
| Storage | localStorage (automatic) | AsyncStorage adapter |
| Browser tools | whatsOnScreen, refresh | Register your own native tools |
| Provider | CrowProvider from @usecrow/ui | CrowProvider from @usecrow/react-native |
