Hide intercom access token in react app
User lookup for in-app messaging without leaks
Intercom contacts and events via edge proxy with server-side Bearer token. For "hide intercom access token in react app", store INTERCOM_ACCESS_TOKEN in Secret Vault, call https://api.intercom.io/contacts from a Worker, and let React hit only https://realcomposer.com/v1/workspace/hide-intercom-access-token-react with an rc_live_ client token.
Why React leaks Intercom credentials
Attackers routinely extract Intercom secrets from React builds. Direct browser calls also expose internal error payloads with hostnames.
- Production Intercom keys copied from React bundles
- Compliance violations after credential leaks
- Attackers replaying vault-grade scopes from a laptop
How RealComposer Solves This at the Edge
Store upstream credentials in Secret Vault
Add INTERCOM_ACCESS_TOKEN to RealComposer Secret Vault. Values decrypt only inside the Cloudflare Worker that calls the upstream.
Target the real upstream URL
Use GET against https://api.intercom.io/contacts. 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
Allowed origins on the token should list every React host that calls this URL.
const res = await fetch('https://realcomposer.com/v1/workspace/hide-intercom-access-token-react', {
headers: { Authorization: 'Bearer rc_live_your_token' }
});
const data = await res.json();
{
"requestId": "req_hide-int",
"upstreamLatencyMs": 142,
"audit": {
"region": "edge",
"trace": "hide-intercom-access-token-react"
},
"payload": {
"id": "sample_id",
"status": "active",
"nested": {
"tags": [
"demo"
],
"internal": true
},
"unused_blob": {
"foo": "bar",
"bar": "baz"
}
}
}
{
"contactId": "sample",
"email": "sample"
}
Recipe Specs
- HTTP method
- GET
- Upstream calls
- 1
- Edge cache TTL
- No caching
- Client auth
- Restricted client token
- Mapped output fields
- 2
- Payload
- 251 B to 39 B (-84%)
curl -X GET "https://realcomposer.com/v1/workspace/hide-intercom-access-token-react" \ -H "Authorization: Bearer rc_live_client_token"
Developer Questions & Troubleshooting
Which Intercom credential belongs in the vault for this pipeline?
Log request IDs for hide-intercom-access-token-react, not raw Intercom payloads, because upstream bodies may include PII.
What cache key does RealComposer use?
hide-intercom-access-token-react vault headers attach server-side, but Anthropic or OpenAI model and messages must come from the client body.
Can I restrict which domains call this pipeline?
Upstream steps in hide-intercom-access-token-react honor timeoutMs and optional fallback JSON without leaking secrets.
Sources & Definitions Used in This Answer
Deploy this React + Intercom Recipe
Clone this pre-configured pipeline into your RealComposer workspace in one click. We pre-populate upstream URLs, headers, and mapping rules.