Pexels + Pixabay (Native)
Both providers implement the shared MediaClient interface from @media-sdk/core. Construct clients at the app shell and pass them to MediaProvider. Gate UI with useMediaCapabilities.
Client setup
Pexels
tsx
import { ApiKeyProvider, PexelsMediaClient } from "@media-sdk/core";
const client = new PexelsMediaClient(
new ApiKeyProvider(process.env.EXPO_PUBLIC_PEXELS_API_KEY!),
);Pixabay
tsx
import { ApiKeyProvider, PixabayMediaClient } from "@media-sdk/core";
const client = new PixabayMediaClient(
new ApiKeyProvider(process.env.EXPO_PUBLIC_PIXABAY_API_KEY!),
);Operations matrix
Values from PexelsMediaClient.capabilities and PixabayMediaClient.capabilities in @media-sdk/core:
| Operation | Pexels | Pixabay |
|---|---|---|
searchPhotos | ✅ | ✅ |
searchVideos | ✅ | ✅ |
getPhoto | ✅ | ✅ |
getVideo | ✅ | ✅ |
curatedPhotos | ✅ | ❌ |
trackView | ✅ | ✅ |
trackDownload | ✅ | ✅ |
Calling getCuratedPhotos() on Pixabay throws MediaError with code: "UNSUPPORTED_CAPABILITY".
Photo filter matrix
| Filter | Pexels | Pixabay |
|---|---|---|
orientation | ✅ | ✅ |
size | ✅ | ❌ |
color | ✅ | ✅ |
category | ❌ | ✅ |
minWidth | ❌ | ✅ |
minHeight | ❌ | ✅ |
editorsChoice | ❌ | ✅ |
locale | ✅ | ✅ |
Video filter matrix
| Filter | Pexels | Pixabay |
|---|---|---|
orientation | ✅ | ❌ |
size | ✅ | ❌ |
color | ❌ | ❌ |
category | ❌ | ✅ |
minWidth | ❌ | ✅ |
minHeight | ❌ | ✅ |
editorsChoice | ❌ | ✅ |
locale | ✅ | ❌ |
Runtime discovery
tsx
import { useMediaCapabilities } from "@media-sdk/native";
const caps = useMediaCapabilities();
// Pexels: true, Pixabay: false
caps.operations.curatedPhotos;
// Pexels: true, Pixabay: false
caps.photoFilters.size;Or without hooks:
ts
import { getCapabilities, PexelsMediaClient } from "@media-sdk/core";
getCapabilities(new PexelsMediaClient(auth)).operations.curatedPhotos; // trueProvider-specific docs
- PexelsMediaClient (core)
- PixabayMediaClient (core)
- Web provider comparison — same matrix, web context
Related
- Capabilities — UI gating patterns
- Filters — forwarding to hooks
- Expo example — multi-provider demo