RealComposer
JavaScript / HTMLSalesforceSecurity & Secret Vault

Hide salesforce api credentials in javascript client app

Keep Salesforce tokens off the browser

Direct Answer & Architecture Summary

Edge pipeline attaches Bearer tokens so static sites never embed secrets. For "hide salesforce api credentials in javascript client app", store SALESFORCE_ACCESS_TOKEN in Secret Vault, call https://{{secrets.SALESFORCE_INSTANCE}}.my.salesforce.com/services/data/v68.0/sobjects/Contact/{{query.contactId}} from a Worker, and let JavaScript / HTML hit only https://realcomposer.com/v1/workspace/hide-salesforce-credentials-javascript with an rc_live_ client token.

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

Why JavaScript / HTML leaks Salesforce credentials

Attackers routinely extract Salesforce secrets from JavaScript / HTML builds. Direct browser calls also expose internal error payloads with hostnames.

Critical Security & Operational Risks:
  • Production Salesforce keys copied from JavaScript / HTML 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

Create SALESFORCE_ACCESS_TOKEN vault entries, then bind them to this pipeline step headers with {{secrets.NAME}} placeholders.

2

Configure upstream steps and output mapping

Use GET against https://{{secrets.SALESFORCE_INSTANCE}}.my.salesforce.com/services/data/v68.0/sobjects/Contact/{{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 JavaScript / HTML

Authorize with Bearer rc_live_ and fetch the mapped JSON contract your UI already expects.

                    const data = await fetch('https://realcomposer.com/v1/workspace/hide-salesforce-credentials-javascript', {
  headers: { Authorization: 'Bearer rc_live_your_token' }
}).then(r => r.json());
                  
Payload Slimming Comparison
79% Bandwidth Reduction
Raw Upstream Response257 B
              {
  "requestId": "req_hide-sal",
  "upstreamLatencyMs": 142,
  "audit": {
    "region": "edge",
    "trace": "hide-salesforce-credentials-javascript"
  },
  "payload": {
    "id": "sample_id",
    "status": "active",
    "nested": {
      "tags": [
        "demo"
      ],
      "internal": true
    },
    "unused_blob": {
      "foo": "bar",
      "bar": "baz"
    }
  }
}
            
RealComposer Slimmed Edge Payload55 B
              {
  "contactId": "sample",
  "email": "sample",
  "name": "sample"
}
            

Recipe Specs

HTTP method
GET
Upstream calls
1
Edge cache TTL
No caching
Client auth
Restricted client token
Mapped output fields
3
Payload
257 B to 55 B (-79%)
Call from Terminal or Client
curl -X GET "https://realcomposer.com/v1/workspace/hide-salesforce-credentials-javascript" \
  -H "Authorization: Bearer rc_live_client_token"
Frequently Asked Questions

Developer Questions & Troubleshooting

What should JavaScript / HTML store instead of Salesforce secrets?

Yes for hide-salesforce-credentials-javascript. Ship only an rc_live_ client token in JavaScript / HTML; RealComposer injects SALESFORCE_ACCESS_TOKEN on https://{{secrets.SALESFORCE_INSTANCE}}.my.salesforce.com/services/data/v68.0/sobjects/Contact/{{query.contactId}}.

Will Anthropic or Linear prompt bodies be rewritten?

hide-salesforce-credentials-javascript forwards client JSON to POST upstreams unchanged; secrets interpolate only in URLs and header templates.

Can I restrict which domains call this pipeline?

Upstream steps in hide-salesforce-credentials-javascript honor timeoutMs and optional fallback JSON without leaking secrets.

Sources & Definitions Used in This Answer

Instant Deployment

Deploy this JavaScript / HTML + Salesforce 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