Skip to main content
The API of the expo-rollup module. Expo and React Native explains how to install it. Each function wraps a call of the Swift SDK, and each value has the fields of its Swift type, in the shapes below. The package ships these TypeScript types.

Setup

configure

Sets up the SDK with your app’s publishable key and what to index. Options you leave out keep the SDK’s defaults: the last three months, growing, of photos, screenshots and videos. Call it once when your app starts. Calling it again changes the options, and the index follows them. Rejects with missingRequirement when the app lacks something the SDK needs, and with simulatorUnsupported in the iOS Simulator.

requestPhotoAccess

Shows the system Photos prompt (once) and returns the person’s answer. Call it right after the person chooses to turn the feature on: a grant starts the first index, which continues in the background.

startIndexing

Starts indexing, or lets it continue in the background. Call it from a user action, such as a button press.

pauseIndexing

Pauses indexing until resumeIndexing. Indexing under way stops, and what it finished stays searchable. Nothing is indexed, in the foreground or the background, not even new photos. The pause lasts across launches, and reset ends it. While paused, startIndexing does nothing.

resumeIndexing

Ends a pause and starts indexing as startIndexing does. Call it from a user action, such as a button press.

isIndexingPaused

Whether indexing is paused.

getIndexOptions

The index options in effect.

reset

Deletes everything the SDK keeps: the index, downloaded models and places, queued reports, and this device’s record on Rollup’s server. No new index starts until startIndexing, resumeIndexing or the next launch. To index again without downloading the models again, use deleteIndex.

deleteIndex

Deletes the index and keeps the downloaded models and places, the options and a pause. Indexing under way stops first. No new index starts until startIndexing, resumeIndexing or the next launch.

Indexing state

useIndexingState

A React hook that keeps the indexing state current. It is null until the first state arrives, and always null where Rollup is not available.

getIndexingState

Where indexing is now.

addIndexingStateListener

Calls listener with the current state and every change after it, until you call remove().

addIndexedBatchListener

Calls listener with the photos each part of a run makes searchable, from now on, until you call remove(). Use it to add photos to the screen as they are indexed, instead of searching again.

isSearchable

Whether search, query and profile have an index to read: the state is preparing, indexing, ready, unfinished or paused, with searchable true.

Search, query and profile

Searches the index on the iPhone: dates, places, media and what photos show or say. Results come most relevant first. people keeps only photos with every one of those people in them. limit is how many results to return: 500 (defaultSearchLimit) when left out, null for all of them. offset skips that many, for the next page. totalCount counts every match, so you can tell when results were cut. Pages can shift while indexing adds photos: if a page’s totalCount differs from the first page’s, start again from offset 0. See Search.

query

Answers a question about the person’s life from the index. The model runs on Rollup’s server; its tools run on the iPhone, and only their text results leave it. Tell the person and get their permission first. See Query and Privacy.

profile

Fills a JSON Schema (an object schema) about the person from the index: the schema’s shape exactly, null where their life does not say, with the photos behind each filled field. Pass the schema as an object. Same permission as query. See Profile.

facets

The index’s largest groups (labels, kinds of place, cuisines and food), largest first, each with its count and a few photos. limit defaults to 16 (up to 64), samples to 4 (up to 32). See Facet.

People and interests

people

The people whose faces are in the person’s photos, most photos first, with people on. People in only one photo are left out unless includeAll. See Person.

photosOf

Every photo with that person’s face in it, newest first.

interests

What the person does, from their camera roll, scored against a typical adult. now (the default) returns active and emerging interests; lifetime adds lapsed ones. See Interest.

activityTaxonomy

Rollup’s activity taxonomy: every activity that activities and interests use.

Availability

isAvailable is true on iOS 26 or later with the native module linked. Elsewhere, including iOS 16 to 25, it is false, sdkVersion is null, and every call rejects with unsupportedPlatform.

Helpers

indexWindow.growing reaches back from and keeps adding new photos; nothing ages out. indexWindow.sliding keeps only the most recent span, and removes older photos as time passes.

Types

Enums are objects tagged by type. Dates are ISO 8601 strings.

IndexingState

The state is flat: a progress or summary’s fields sit next to type. IndexingState explains each field. Later versions can add states, so handle a default case.

IndexedBatch and Facet

IndexedBatch and Facet explains each field.

PhotoAccess

IndexOptionsInput and IndexOptions

configure takes the fields to change; every field you leave out keeps the SDK’s default. getIndexOptions returns every field. See Index options for what each one does.

SearchResults

See SearchResults for what each field means.

Person, Interest and ActivityNode

Person and Interest explain each field.

Answer

Profile

json is a parsed object, not a string. Pass your own type to profile<T>() to type it. Keys of evidence are JSON Pointers, such as /food/favorite_cuisine.

JSONValue

Errors

Every call rejects with a RollupError:
message is for developers, not for the person. A failed indexing state carries the same fields as a plain object (RollupErrorBody).
Every code but the last two comes from the Swift SDK. See RollupError for what each one means and Troubleshooting for what to do.