Combine intercom with posthog user events
Support tool with product analytics context
Intercom conversation list plus PostHog person properties in one payload. For "combine intercom with posthog user events", store INTERCOM_ACCESS_TOKEN, POSTHOG_PERSONAL_API_KEY in Secret Vault, call https://api.intercom.io/contacts from a Worker, and let React hit only https://realcomposer.com/v1/workspace/combine-intercom-with-posthog-events with an rc_live_ client token.
Serial Intercom and PostHog calls slow React pages
Each extra Intercom and PostHog hop adds hundreds of milliseconds and another OAuth refresh path your UI must manage.
- One slow upstream blocking an entire page
- Partial failures leaving UI in inconsistent states
- Duplicate auth refresh logic per service
How RealComposer Solves This at the Edge
Add vault secrets for this pipeline
Add INTERCOM_ACCESS_TOKEN, POSTHOG_PERSONAL_API_KEY to RealComposer Secret Vault. Values decrypt only inside the Cloudflare Worker that calls the upstream.
Configure upstream steps and output mapping
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
Authorize with Bearer rc_live_ and fetch the mapped JSON contract your UI already expects.
const res = await fetch('https://realcomposer.com/v1/workspace/combine-intercom-with-posthog-events', {
headers: { Authorization: 'Bearer rc_live_your_token' }
});
const data = await res.json();
{
"requestId": "req_combine-",
"upstreamLatencyMs": 142,
"audit": {
"region": "edge",
"trace": "combine-intercom-with-posthog-events"
},
"payload": {
"id": "sample_id",
"status": "active",
"nested": {
"tags": [
"demo"
],
"internal": true
},
"unused_blob": {
"foo": "bar",
"bar": "baz"
}
}
}
{
"intercom_contactId": "sample",
"intercom_email": "sample",
"posthog_flagKey": "sample",
"posthog_active": "sample"
}
Recipe Specs
- HTTP method
- GET
- Upstream calls
- 2
- Edge cache TTL
- No caching
- Client auth
- Restricted client token
- Mapped output fields
- 4
- Payload
- 255 B to 110 B (-57%)
curl -X GET "https://realcomposer.com/v1/workspace/combine-intercom-with-posthog-events" \ -H "Authorization: Bearer rc_live_client_token"
Developer Questions & Troubleshooting
What should React store instead of Intercom secrets?
Use scoped tokens where the vendor allows them on combine-intercom-with-posthog-events. Admin keys stay {{secrets.*}} references only.
How do I forward JSON bodies to POST upstreams?
Cache key for combine-intercom-with-posthog-events: internal edge-cache path plus sorted query. Identical params hit; vary userId per user.
Can I restrict which domains call this pipeline?
Rotate vault secrets for combine-intercom-with-posthog-events anytime; clients keep the same rc_live_ token.
Sources & Definitions Used in This Answer
- DefinitionEvent Choreography
- DefinitionReverse ETL
- DefinitionFeature Flags API
- Stack guideReact safe & unsafe practices
- Stack guideIntercom safe & unsafe practices
- Stack guidePostHog safe & unsafe practices
- Official docsReact documentation
- Official docsIntercom documentation
- Official docsPostHog documentation
Deploy this React + Intercom, PostHog Recipe
Clone this pre-configured pipeline into your RealComposer workspace in one click. We pre-populate upstream URLs, headers, and mapping rules.