RealComposer
Platform

JavaScript / HTML Edge API Recipes

Production-ready templates for calling third-party APIs from JavaScript / HTMLwithout exposing secrets or maintaining a custom backend.

Web Frontends safe & unsafe practices
Security & Secret Vault

Hide salesforce api credentials in javascript client app

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.

Sub-10ms edgeView Recipe
Security & Secret Vault

Hide mailchimp api key in client side javascript

Block browser extraction of list API keys via edge-only authorization headers. For "hide mailchimp api key in client side javascript", store MAILCHIMP_BASIC_AUTH in Secret Vault, call https://{{secrets.MAILCHIMP_DC}}.api.mailchimp.com/3.0/lists/{{query.listId}}/members?count=10 from a Worker, and let JavaScript / HTML hit only https://realcomposer.com/v1/workspace/hide-mailchimp-api-key-javascript with an rc_live_ client token.

Sub-10ms edgeView Recipe

Mailchimp member json too big filter fields

Drop merge fields stats and _links from list member JSON. For "mailchimp member json too big filter fields", store MAILCHIMP_BASIC_AUTH in Secret Vault, call https://{{secrets.MAILCHIMP_DC}}.api.mailchimp.com/3.0/lists/{{query.listId}}/members?count=10 from a Worker, and let JavaScript / HTML hit only https://realcomposer.com/v1/workspace/filter-mailchimp-member-json-fields with an rc_live_ client token.

Sub-10ms edgeView Recipe
Edge Caching & Rate Limits

Cache mailchimp api to stay under rate limits

Shared edge cache for popular list metadata endpoints. For "cache mailchimp api to stay under rate limits", store MAILCHIMP_BASIC_AUTH in Secret Vault, call https://{{secrets.MAILCHIMP_DC}}.api.mailchimp.com/3.0/lists/{{query.listId}}/members?count=10 from a Worker, and let JavaScript / HTML hit only https://realcomposer.com/v1/workspace/cache-mailchimp-api-avoid-rate-limits with an rc_live_ client token. Enable 300s GET cache only when query params identify the resource.

Sub-10ms edgeView Recipe