RealComposer
ReactIntercomSecurity & Secret Vault

Hide intercom access token in react app

User lookup for in-app messaging without leaks

Direct Answer & Architecture Summary

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.

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

Why React leaks Intercom credentials

Attackers routinely extract Intercom secrets from React builds. Direct browser calls also expose internal error payloads with hostnames.

Critical Security & Operational Risks:
  • Production Intercom keys copied from React bundles
  • Compliance violations after credential leaks
  • Attackers replaying vault-grade scopes from a laptop
Architecture & Step-by-Step Implementation

How RealComposer Solves This at the Edge

1

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.

2

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).

3

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();
                  
Payload Slimming Comparison
84% Bandwidth Reduction
Raw Upstream Response251 B
              {
  "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"
    }
  }
}
            
RealComposer Slimmed Edge Payload39 B
              {
  "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%)
Call from Terminal or Client
curl -X GET "https://realcomposer.com/v1/workspace/hide-intercom-access-token-react" \
  -H "Authorization: Bearer rc_live_client_token"
Frequently Asked Questions

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

Instant Deployment

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.

CLONE THIS RECIPE
Related Architecture Recipes