window.supercycleAppEmbed.context.proxyPathPrefix and will usually look like /apps/supercycle this will need to be prepended to all requests made to the storefront API.
Making storefront API requests to Supercycle.
window.supercycleAppEmbed.context.proxyPathPrefix and will usually look like /apps/supercycle this will need to be prepended to all requests made to the storefront API.
async function supercycleFetch(method, path, options) {
if (!path.startsWith("/")) path = `/${url}`;
const { proxyPathPrefix } = window.supercycleAppEmbed.context
const response = await fetch(proxyPathPrefix + path, {
method,
headers: { "Content-Type": "application/json" },
...options,
});
return response.json();
}
Was this page helpful?