RealComposer
Mobile App (iOS & Android)NotionSecurity & Secret Vault

Call Notion API from Mobile App without Token Leakage

Vault-backed Notion proxy tuned for Mobile App (iOS & Android)

Direct Answer & Architecture Summary

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.

Security LevelAES-256-GCM Vault
Edge LatencySub-10ms Response
InfrastructureZero Server Maintenance
The Problem Solved

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.

Critical Security & Operational Risks:
  • Shared Mobile App (iOS & Android) projects revealing Notion tokens
  • Sudden Notion quota burn from scripted abuse
  • Inability to rotate keys without redeploying clients
Architecture & Step-by-Step Implementation

How RealComposer Solves This at the Edge

1

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.

2

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.

3

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")
                  
Payload Slimming Comparison
85% Bandwidth Reduction
Raw Upstream Response242 B
              {
  "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"
    }
  }
}
            
RealComposer Slimmed Edge Payload36 B
              {
  "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%)
Call from Terminal or Client
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"}'
Frequently Asked Questions

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

Instant Deployment

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.

CLONE THIS RECIPE
Related Architecture Recipes