Hubspot Contact JSON Filter Out Empty Properties
Field-level HubSpot projection at the edge
HubSpot responses include fields Frontend / Web never renders. Map id, status, and UI columns at the edge after calling https://api.hubapi.com/crm/v3/objects/contacts/{{query.contactId}}.
Unmapped HubSpot fields waste bandwidth
HubSpot returns nested CRM, audit, and configuration objects. Frontend / Web parses them on the main thread even when the UI binds three fields.
- Large arrays kept in memory after navigation
- Analytics showing poor LCP on API-heavy screens
- Developers shipping defensive null checks for unused paths
How RealComposer Solves This at the Edge
Add vault secrets for this pipeline
Add HUBSPOT_ACCESS_TOKEN to RealComposer Secret Vault. Values decrypt only inside the Cloudflare Worker that calls the upstream.
Configure upstream steps and output mapping
Point step hubspot at https://api.hubapi.com/crm/v3/objects/contacts/{{query.contactId}} with GET. Map only the UI fields in output mapping so clients never download audit or nested blobs. Leave cache TTL at 0 when each response is user-specific (include userId or record id in query params before enabling cache).
Call from Frontend / Web
Allowed origins on the token should list every Frontend / Web host that calls this URL.
const res = await fetch('https://realcomposer.com/v1/workspace/filter-empty-hubspot-properties', {
headers: { Authorization: 'Bearer rc_live_your_token' }
});
{
"requestId": "req_filter-e",
"upstreamLatencyMs": 142,
"audit": {
"region": "edge",
"trace": "filter-empty-hubspot-properties"
},
"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
- 250 B to 39 B (-84%)
curl -X GET "https://realcomposer.com/v1/workspace/filter-empty-hubspot-properties" \ -H "Authorization: Bearer rc_live_client_token"
Developer Questions & Troubleshooting
Which HubSpot credential belongs in the vault for this pipeline?
Yes for filter-empty-hubspot-properties. Ship only an rc_live_ client token in Frontend / Web; RealComposer injects HUBSPOT_ACCESS_TOKEN on https://api.hubapi.com/crm/v3/objects/contacts/{{query.contactId}}.
What cache key does RealComposer use?
filter-empty-hubspot-properties POST steps bypass caches.default even if cacheTtlSeconds is set in the dashboard.
Can I restrict which domains call this pipeline?
Upstream steps in filter-empty-hubspot-properties honor timeoutMs and optional fallback JSON without leaking secrets.
Sources & Definitions Used in This Answer
Deploy this Frontend / Web + HubSpot Recipe
Clone this pre-configured pipeline into your RealComposer workspace in one click. We pre-populate upstream URLs, headers, and mapping rules.