expo-rollup brings the Rollup SDK to Expo and React Native apps. It wraps the native iOS SDK: indexing and search run in Swift on the iPhone, and the module passes calls and results to JavaScript. Its config plugin sets up your iOS project for you.
Before you start
- An app in the developer dashboard, with your Apple Team ID, your app’s bundle ID and its publishable key (
rk_live_...). The Quickstart explains how to get one. - A development build. Expo Go does not include this module.
- A real iPhone with iOS 26 or later. Development builds on a device work: they attest in Apple’s development App Attest environment, which Rollup accepts.
Install
1
Add the package
2
Add the config plugin
In The bundle ID must be the one you registered in the dashboard.
app.json or app.config.js, add the plugin with the text iOS shows when it asks for Photos access:app.json
3
Build for your iPhone
NSPhotoLibraryUsageDescription, from thephotosPermissionoption.- The background task identifiers
<bundle ID>.rollup.indexing.*and<bundle ID>.rollup.updateinBGTaskSchedulerPermittedIdentifiers, andprocessinginUIBackgroundModes. - The App Attest entitlement.
- An iOS deployment target of at least 16.0. A higher one you set is kept.
- The Rollup pod in your Podfile, from Rollup’s podspec. Rollup is not on CocoaPods trunk.
Plugin options
Bare React Native
Set up Expo Modules first (npx install-expo-modules@latest), then install the package with npm install expo-rollup. Without a config plugin, make its changes yourself: the Info.plist entries and App Attest capability from the Quickstart, an iOS deployment target of 16.0 or later, and this line in your Podfile’s app target, after use_expo_modules!:
Podfile
Use
configure starts indexing and downloading models right away. To index only for people who turn the feature on, call configure once they do, and at every launch after that.
In a component, useIndexingState keeps the indexing state current, and isSearchable tells you when search, query and profile have an index to read:
Showing photos
Results identify photos by their PhotoKit local identifier:result.id in search results, answer.assetIdentifiers for an answer, and profile.evidence for each filled field. Show them with expo-media-library, or in React Native’s Image with a ph:// URI:
Errors
Calls reject with aRollupError. Its code is one of the Swift SDK’s error codes, or one of two that come from the module: unsupportedPlatform (not an iPhone) and invalidOptions (index options the SDK can’t read). Errors from Rollup’s server also carry serverCode, retryable and retryAfter.
API
Values have the same fields as the Swift types, with dates as ISO 8601 strings and enums as objects tagged by
type (for example { type: 'indexing', indexed: 120, total: 5400, fraction: 0.03, ... }). The package ships TypeScript types for all of them, and JavaScript API lists every function and type.
queryUpdates, which streams an answer as it is written, is not in the module yet. Use query for the finished answer.
Releasing your app
expo-rollup adds native code, so the first release that includes it must be a new build through App Store review. EAS Update and other over-the-air updates cannot add it. After it ships, changes to the JavaScript that calls Rollup can go out over the air, but a new expo-rollup version needs a new build.
Versions
Privacy and App Review
search runs on the iPhone. query and profile send text the index derived from the person’s photos to Rollup’s server and its model provider: dates, places, labels and text read in photos. Before your app calls them, tell the person and get their permission. App Store Review Guideline 5.1.2(i) requires this for personal data shared with third-party AI. See Privacy.