Contentful api response slim down for mobile app
Lightweight CMS payloads on cellular
Returns entry sys id fields and locale only from Delivery API. For "contentful api response slim down for mobile app", store CONTENTFUL_ACCESS_TOKEN in Secret Vault, call https://cdn.contentful.com/spaces/{{query.spaceId}}/entries from a Worker, and let React Native hit only https://realcomposer.com/v1/workspace/slim-contentful-api-response-mobile with an rc_live_ client token.
Unmapped Contentful fields waste bandwidth
Contentful returns nested CRM, audit, and configuration objects. React Native parses them on the main thread even when the UI binds three fields.
- Large arrays kept in memory after navigation
- Analytics showing poor LCP on API-heavy screens
- Developers shipping defensive null checks for unused paths
How RealComposer Solves This at the Edge
Bind vault keys to the Worker
Store CONTENTFUL_ACCESS_TOKEN in the vault. React Native never embeds the raw secret, only a revocable rc_live_ client token.
Set headers, mapping, and cache TTL
Use GET against https://cdn.contentful.com/spaces/{{query.spaceId}}/entries. Allowed origins on the client token should match leave cache ttl at 0 when each response is user-specific (include userid or record id in query params before enabling cache).
Call from React Native
Authorize with Bearer rc_live_ and fetch the mapped JSON contract your UI already expects.
const res = await fetch('https://realcomposer.com/v1/workspace/slim-contentful-api-response-mobile', {
headers: { Authorization: 'Bearer rc_live_your_token' }
});
{
"requestId": "req_slim-con",
"upstreamLatencyMs": 142,
"audit": {
"region": "edge",
"trace": "slim-contentful-api-response-mobile"
},
"payload": {
"id": "sample_id",
"status": "active",
"nested": {
"tags": [
"demo"
],
"internal": true
},
"unused_blob": {
"foo": "bar",
"bar": "baz"
}
}
}
{
"entryId": "sample",
"title": "sample"
}
Recipe Specs
- HTTP method
- GET
- Upstream calls
- 1
- Edge cache TTL
- No caching
- Client auth
- Restricted client token
- Mapped output fields
- 2
- Payload
- 254 B to 37 B (-85%)
curl -X GET "https://realcomposer.com/v1/workspace/slim-contentful-api-response-mobile" \ -H "Authorization: Bearer rc_live_client_token"
Developer Questions & Troubleshooting
What should React Native store instead of Contentful secrets?
Point React Native at /recipes/slim-contentful-api-response-mobile edge URL. RealComposer answers OPTIONS with Access-Control headers for allowed origins.
Will Anthropic or Linear prompt bodies be rewritten?
Cache key for slim-contentful-api-response-mobile: internal edge-cache path plus sorted query. Identical params hit; vary userId per user.
How do I rotate upstream credentials?
Rotate vault secrets for slim-contentful-api-response-mobile anytime; clients keep the same rc_live_ token.
Sources & Definitions Used in This Answer
Deploy this React Native + Contentful Recipe
Clone this pre-configured pipeline into your RealComposer workspace in one click. We pre-populate upstream URLs, headers, and mapping rules.