{
  "slug": "filter-empty-hubspot-properties",
  "title": "Hubspot Contact JSON Filter Out Empty Properties",
  "metaTitle": "Hubspot Contact JSON Filter Out - RealComposer",
  "metaDescription": "Hubspot contact json filter out empty properties. Map only UI fields from HubSpot before Frontend / Web parses JSON. RealComposer edge vault and client tok",
  "headline": "Field-level HubSpot projection at the edge",
  "category": "slimmer",
  "categoryLabel": "Payload Slimmer",
  "urgency": 8,
  "clientPlatform": "Frontend / Web",
  "upstreamServices": [
    "HubSpot"
  ],
  "searchIntentQuery": "hubspot contact json filter out empty properties",
  "directAnswerSummary": "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}}.",
  "problem": {
    "title": "Unmapped HubSpot fields waste bandwidth",
    "explanation": "HubSpot returns nested CRM, audit, and configuration objects. Frontend / Web parses them on the main thread even when the UI binds three fields.",
    "risks": [
      "Large arrays kept in memory after navigation",
      "Analytics showing poor LCP on API-heavy screens",
      "Developers shipping defensive null checks for unused paths"
    ]
  },
  "solutionSteps": [
    {
      "stepNumber": 1,
      "title": "Add vault secrets for this pipeline",
      "description": "Add HUBSPOT_ACCESS_TOKEN to RealComposer Secret Vault. Values decrypt only inside the Cloudflare Worker that calls the upstream."
    },
    {
      "stepNumber": 2,
      "title": "Configure upstream steps and output mapping",
      "description": "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)."
    },
    {
      "stepNumber": 3,
      "title": "Call from Frontend / Web",
      "description": "Allowed origins on the token should list every Frontend / Web host that calls this URL.",
      "codeSnippet": "const res = await fetch('https://realcomposer.com/v1/workspace/filter-empty-hubspot-properties', {\n  headers: { Authorization: 'Bearer rc_live_your_token' }\n});"
    }
  ],
  "pipelineConfig": {
    "name": "Hubspot Contact JSON Filter Out Empty Properties",
    "method": "GET",
    "cacheTtlSeconds": 0,
    "authMode": "client_token",
    "steps": [
      {
        "stepKey": "hubspot",
        "upstreamUrlTemplate": "https://api.hubapi.com/crm/v3/objects/contacts/{{query.contactId}}",
        "httpMethod": "GET",
        "headersTemplate": {
          "Authorization": "Bearer {{secrets.HUBSPOT_ACCESS_TOKEN}}"
        },
        "timeoutMs": 3000
      }
    ],
    "outputMapping": {
      "version": 1,
      "fields": [
        {
          "targetPath": "contactId",
          "sourcePath": "id",
          "type": "string",
          "sourceStep": "hubspot"
        },
        {
          "targetPath": "email",
          "sourcePath": "properties.email",
          "type": "string",
          "sourceStep": "hubspot"
        }
      ]
    }
  },
  "sampleBloatedInput": {
    "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"
      }
    }
  },
  "sampleSlimmedOutput": {
    "contactId": "sample",
    "email": "sample"
  },
  "curlSnippet": "curl -X GET \"https://realcomposer.com/v1/workspace/filter-empty-hubspot-properties\" \\\n  -H \"Authorization: Bearer rc_live_client_token\"",
  "faqs": [
    {
      "question": "Which HubSpot credential belongs in the vault for this pipeline?",
      "answer": "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}}."
    },
    {
      "question": "What cache key does RealComposer use?",
      "answer": "filter-empty-hubspot-properties POST steps bypass caches.default even if cacheTtlSeconds is set in the dashboard."
    },
    {
      "question": "Can I restrict which domains call this pipeline?",
      "answer": "Upstream steps in filter-empty-hubspot-properties honor timeoutMs and optional fallback JSON without leaking secrets."
    }
  ],
  "relatedRecipeSlugs": [
    "edge-caching-reverse-proxy",
    "clerk-backend-api-proxy",
    "transform-and-rename-nested-json-keys"
  ],
  "updatedAt": "2026-11-20",
  "links": {
    "page": "https://realcomposer.com/recipes/filter-empty-hubspot-properties",
    "markdown": "https://realcomposer.com/recipes/filter-empty-hubspot-properties.md",
    "json": "https://realcomposer.com/recipes/filter-empty-hubspot-properties.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=filter-empty-hubspot-properties&via=agent"
  }
}