Call Notion API from Mobile App without Token Leakage
Vault-backed Notion proxy tuned for Mobile App (iOS & Android)
Never place NOTION_API_KEY inside Mobile App (iOS & Android) source. RealComposer injects them when calling https://api.notion.com/v1/databases/{{query.databaseId}}/query, so browsers see only a client token.
Notion keys in Mobile App (iOS & Android) network tabs
Mobile App (iOS & Android) ships code or scripts to end-user devices. Any Notion bearer token in those bundles can be copied from DevTools, proxies, or repackaged apps.
- Shared Mobile App (iOS & Android) projects revealing Notion tokens
- Sudden Notion quota burn from scripted abuse
- Inability to rotate keys without redeploying clients
How RealComposer Solves This at the Edge
Add vault secrets for this pipeline
Add NOTION_API_KEY to RealComposer Secret Vault. Values decrypt only inside the Cloudflare Worker that calls the upstream.
Set headers, mapping, and cache TTL
Configure headersTemplate to inject vault secrets, target https://api.notion.com/v1/databases/{{query.databaseId}}/query, and Add output mapping fields that mirror the JSON contract your screen already expects.
Call from Mobile App (iOS & Android)
Authorize with Bearer rc_live_ and fetch the mapped JSON contract your UI already expects.
let url = URL(string: "https://realcomposer.com/v1/workspace/notion-api-mobile-proxy")!
var request = URLRequest(url: url)
request.addValue("Bearer rc_live_token", forHTTPHeaderField: "Authorization")
{
"requestId": "req_notion-a",
"upstreamLatencyMs": 142,
"audit": {
"region": "edge",
"trace": "notion-api-mobile-proxy"
},
"payload": {
"id": "sample_id",
"status": "active",
"nested": {
"tags": [
"demo"
],
"internal": true
},
"unused_blob": {
"foo": "bar",
"bar": "baz"
}
}
}
{
"pageId": "sample",
"title": "sample"
}
Recipe Specs
- HTTP method
- POST
- Upstream calls
- 1
- Edge cache TTL
- No caching
- Client auth
- Restricted client token
- Mapped output fields
- 2
- Payload
- 242 B to 36 B (-85%)
curl -X POST "https://realcomposer.com/v1/workspace/notion-api-mobile-proxy" \
-H "Authorization: Bearer rc_live_client_token" \
-H "Content-Type: application/json" \
-d '{"model":"example"}'Developer Questions & Troubleshooting
Is it safe to log Notion responses in Mobile App (iOS & Android)?
Use scoped tokens where the vendor allows them on notion-api-mobile-proxy. Admin keys stay {{secrets.*}} references only.
When does edge caching apply to this recipe?
notion-api-mobile-proxy keeps cache TTL at 0 because it uses POST upstream calls or per-user responses. Add ids to query strings before enabling GET cache.
Can I restrict which domains call this pipeline?
Rotate vault secrets for notion-api-mobile-proxy anytime; clients keep the same rc_live_ token.
Sources & Definitions Used in This Answer
Deploy this Mobile App (iOS & Android) + Notion Recipe
Clone this pre-configured pipeline into your RealComposer workspace in one click. We pre-populate upstream URLs, headers, and mapping rules.