Expo SDK 55 — MediaLibrary@next and Contacts@next
Key Points
- shared objects & refs
- query builder for media
- patch() + getDetails for contacts
Summary
SDK 55 introduces next-generation Expo APIs for media and contacts via expo-media-library/next and expo-contacts/next. The libraries use Shared Objects & Shared Refs to expose object-oriented proxies to native data (Asset, Album, Contact), offering granular getters, builder-style queries, performant batched reads, and safe partial updates. These changes reduce boilerplate, avoid passing IDs everywhere, and improve TypeScript ergonomics.
Key Points
-
MediaLibrary@next
- Asset and Album are proxy classes that reference native gallery items.
- Create assets with
await Asset.create(uri)and manage albums viaAlbum.get()/Album.create(). - Granular getters (e.g.,
asset.getLocation(),asset.getShape(),asset.getInfo()) avoid fetching full metadata when unnecessary. - New Query builder supports predicates (gt, gte, lte, lt, eq, within, album),
orderBy,limit, andoffsetfor readable, composable filtering.
-
Contacts@next
- Contact instances reference system contacts and expose async instance methods; create/fetch/pick via
Contact.create(),Contact.getAll(),Contact.presentPicker(). - Fine-grained operations:
contact.addEmail(...),contact.setImage(uri), and getters likecontact.getGivenName()for minimal round-trips. getDetails([...fields])andgetAllDetails([...])return narrowed types (TypeScript warns when accessing unfetched fields).patch()applies partial updates (skips undefined fields) and pairs naturally withgetDetails();update()still replaces the whole contact.
- Contact instances reference system contacts and expose async instance methods; create/fetch/pick via
-
Migration & practical notes
- New packages are published under
expo-media-library/nextandexpo-contacts/next; expect further library migrations in future SDKs. - Prioritize switching to granular getters/queries and instance methods to reduce data transfer and avoid ID-management bugs.
- Check the new docs and open issues/feature requests on GitHub for feedback or migration questions.
- New packages are published under
Recommended actions for engineers
- Try
expo-media-library/nextandexpo-contacts/nextin a branch; replace heavy metadata calls with granular getters. - Adopt Query builder patterns for media filtering and
getDetails()+patch()for contact forms to minimize updates and improve performance. - Validate TypeScript types after narrowing-based calls to catch missing-field access at compile time.