RealComposer

Jamstack Sites Safe & Unsafe Practices

Direct Answer

Static Jamstack sites have no server at request time, so any key referenced in their JavaScript is public. Fetch secret data at build time or through an edge function or proxy, and configure CORS on the endpoint rather than relying on the browser.

Credentials & Where They Belong

Server only
Build-time secrets

Safe in the build environment if never written into output files.

Client safe
Runtime client tokens

Revocable tokens for calling your own proxy.

Safe Practices

  • Move dynamic calls to an edge proxy

    Edge endpoints add secrets, CORS, and caching without running a server.

  • Rebuild or revalidate for content updates

    Prefer build-time fetching for content that rarely changes.

Unsafe Practices

  • Inlining API keys into static JavaScript

    Every visitor downloads the key with the page.

  • Using CORS proxies run by third parties

    Public CORS proxies can log or modify your traffic and credentials.

The RealComposer Pattern

Replace serverless glue with a RealComposer pipeline: one edge URL with OPTIONS handling, vault secrets, and cached responses.

START BUILDING FREE

Frequently Asked Questions

Q:How do static sites call private APIs?

Through an edge function or proxy that holds the secret and returns only safe data.

Platforms & Frameworks

Salesforce api composition tool for indie hackers

Wire Salesforce REST from static sites with vault injection and no Express server. For "salesforce api composition tool for indie hackers", 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 Static HTML / Jamstack hit only https://realcomposer.com/v1/workspace/salesforce-api-composition-indie-hackers with an rc_live_ client token.

Sub-10ms edgeView Recipe

Merge contentful with openweather for location pages

Contentful page body and OpenWeather current conditions in parallel. For "merge contentful with openweather for location pages", store CONTENTFUL_ACCESS_TOKEN, OPENWEATHER_API_KEY in Secret Vault, call https://cdn.contentful.com/spaces/{{query.spaceId}}/entries from a Worker, and let Static HTML / Jamstack hit only https://realcomposer.com/v1/workspace/merge-contentful-with-openweather-pages with an rc_live_ client token.

Sub-10ms edgeView Recipe
Edge Caching & Rate Limits

Cache intercom api responses for help center

Edge cache article list JSON for global readers. For "cache intercom api responses for help center", store INTERCOM_ACCESS_TOKEN in Secret Vault, call https://api.intercom.io/contacts from a Worker, and let Static HTML / Jamstack hit only https://realcomposer.com/v1/workspace/cache-intercom-api-help-center with an rc_live_ client token. Enable 600s GET cache only when query params identify the resource.

Sub-10ms edgeView Recipe

Related Concepts