RealComposer
Frontend / WebHubSpotSecurity & Secret Vault

Call Hubspot API from Client Side Web Application

HubSpot secrets stay out of Frontend / Web bundles

Direct Answer & Architecture Summary

Frontend / Web cannot safely store HubSpot production keys. Vault-bound headers reach https://api.hubapi.com/crm/v3/objects/contacts/{{query.contactId}} on Workers while apps call your hubspot-api-client-proxy edge URL.

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

Why Frontend / Web leaks HubSpot credentials

Attackers routinely extract HubSpot secrets from Frontend / Web builds. Direct browser calls also expose internal error payloads with hostnames.

Critical Security & Operational Risks:
  • Production HubSpot keys copied from Frontend / Web 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 HUBSPOT_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.hubapi.com/crm/v3/objects/contacts/{{query.contactId}}. 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 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/hubspot-api-client-proxy', {
  headers: { Authorization: 'Bearer rc_live_your_token' }
});
                  
Payload Slimming Comparison
84% Bandwidth Reduction
Raw Upstream Response243 B
              {
  "requestId": "req_hubspot-",
  "upstreamLatencyMs": 142,
  "audit": {
    "region": "edge",
    "trace": "hubspot-api-client-proxy"
  },
  "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
243 B to 39 B (-84%)
Call from Terminal or Client
curl -X GET "https://realcomposer.com/v1/workspace/hubspot-api-client-proxy" \
  -H "Authorization: Bearer rc_live_client_token"
Frequently Asked Questions

Developer Questions & Troubleshooting

Can Frontend / Web call HubSpot without holding the production key?

Point Frontend / Web at /recipes/hubspot-api-client-proxy edge URL. RealComposer answers OPTIONS with Access-Control headers for allowed origins.

Does POST traffic get cached?

hubspot-api-client-proxy POST steps bypass caches.default even if cacheTtlSeconds is set in the dashboard.

What happens if an upstream step times out?

Upstream steps in hubspot-api-client-proxy honor timeoutMs and optional fallback JSON without leaking secrets.

Sources & Definitions Used in This Answer

Instant Deployment

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.

CLONE THIS RECIPE
Related Architecture Recipes