@gj-kit/expo-media
A hardened Expo and React Native media pipeline with explicit adapters and durable file boundaries.
Current npm latest:
0.6.1
Use it when
Section titled “Use it when”Use it for media selection, upload preparation, hashing, device-library access, and durable local files while your app keeps its own API and storage policy.
Do not use it when
Section titled “Do not use it when”Do not put record ownership, presign authorization, or orphan-cleanup policy in this library.
Golden path
Section titled “Golden path”Outcome: An Expo-backed media kit while your application keeps upload authorization.
1. Install
Section titled “1. Install”pnpm add @gj-kit/expo-media2. Keep the app-owned boundary explicit
Section titled “2. Keep the app-owned boundary explicit”Implement uploadApi in your app for upload intent and completion, then declare explicit file limits.
3. Start with the smallest integration
Section titled “3. Start with the smallest integration”Copy this first, then replace only the app-owned values named above.
import { createMediaKit, type MediaUploadApi } from '@gj-kit/expo-media';
type Asset = { readonly id: string };declare const uploadApi: MediaUploadApi<Asset>; // Your app owns auth and upload URLs.
export const media = createMediaKit({ api: uploadApi, limits: { image: { maxBytes: 15 * 1024 * 1024 } },});Runtime and peers
Section titled “Runtime and peers”Engines: node >=20
| Peer | Supported range | Required for |
|---|---|---|
expo |
>=56.0.0 <58.0.0 |
documented optional subpaths only |
expo-file-system |
>=56.0.0 |
documented optional subpaths only |
expo-image-manipulator |
>=56.0.0 |
documented optional subpaths only |
expo-image-picker |
>=16.0.0 |
documented optional subpaths only |
expo-media-library |
>=56.0.5 |
documented optional subpaths only |
expo-video-thumbnails |
>=8.0.0 |
documented optional subpaths only |
react-native |
>=0.71.0 |
documented optional subpaths only |
Public subpaths
Section titled “Public subpaths”| Entry | Exported symbols |
|---|---|
Root entry |
167 |
./core |
157 |
./device |
1 |
./image |
12 |
./image/pure |
6 |
./picker |
1 |
./save |
1 |
./storage |
10 |
./testing |
36 |
./video |
1 |
./web |
5 |
Safety boundary
Section titled “Safety boundary”Never expose presigned URLs or native URI details in public errors. Keep cleanup authorization and attachment transactions in the consuming application.
API reference
Section titled “API reference”complete API reference contains every public function, class, type, constant, and error contract generated from release declarations. Each item shows its import path, release signature, and package version.