All Demos

Generic Demo

API Proxy

Define a custom provider for any CMS or asset origin. Route both API requests and assets through one tenant domain.

Integration

Setup with createCmsAssetsFetch

Drop this fetch adapter into your Generic client. All matching CMS requests are transparently routed through the API proxy.

Generic + cmsassets-core
import { createGenericProvider, createCmsAssetsFetch } from '@synchronized-studio/cmsassets-core'

const picsum = createGenericProvider({
  id: 'picsum',
  apiHosts: ['picsum.photos'],
  assetHosts: ['picsum.photos'],
})

const cmsFetch = createCmsAssetsFetch({
  tenant: 'generic',
  provider: picsum,
})

// API requests are routed through /~api, asset URLs are rewritten.
const response = await cmsFetch(
  'https://picsum.photos/v2/list?page=1&limit=8'
)

URL Rewriting

What happens under the hood

The SDK intercepts CMS requests and rewrites the URL to your tenant proxy domain. The edge worker then fetches the upstream API, injects credentials, caches the response, and rewrites asset URLs before returning.

Live

Run the proxy call

Hit the button to send a real request through the Orinami edge proxy. The response shows the JSON with rewritten asset URLs highlighted.