For Shopify in particular, they have a headless front-end services called Hydrogen[0] (with optional hosting called Oxygen). It's basically an opinionated wrapper around the storefront[1] and customer account[2] APIs, which allows interacting with the store from the front-end. It allows you to host Shopify on your own domain under your own control and gives a bit more customization than is available via hosted Shopify. It's what I run for the Creature Publishing site[3] and allows some extra customization for wholesale accounts, etc, without the exceptionally expensive enterprise (Shopify Plus) plan. To be completely honest, sometimes I question the decision over a simple hosted shop subdomain. Some light SSR/API calls are necessary for our setup, which is hosted on Cloudflare Pages/Workers.
[0]: https://hydrogen.shopify.dev/
[1]: https://shopify.dev/docs/api/storefront/latest
[2]: https://shopify.dev/docs/api/customer/latest
[3]: https://creaturehorror.com/