RequirementsAnchor link to section titled "Requirements"
- Install the Headless channel. This enables access to the Storefront API and Customer Account API, and lets you manage API tokens.
Steps to update your Hydrogen appAnchor link to section titled "Steps to update your Hydrogen app"
Step 1: Update your Remix adapterAnchor link to section titled "Step 1: Update your Remix adapter"
- In your Hydrogen app, uninstall the Remix adapter for Oxygen:
- Install the Remix adapter for your selected hosting platform. For example:
Step 2: Edit app files for your adapterAnchor link to section titled "Step 2: Edit app files for your adapter"
Typically, when changing Remix adapters, you’ll need to make updates to the following files:
Remix provides templated examples for a range of adapters. Consult your chosen adapter's template files for specific configurations or required edits.
When making changes, make sure that you continue to pass Hydrogen’s Storefront API client to the Remix loader context. Typically, this involves editing the updated
server.js file using the
createRequestHandler function provided by your chosen adapter.
The following example shows some changes that your app might require:
cache object should implement the standard Web Cache API. Check with your chosen hosting platform for more details about its caching implementation.
waitUntil method is used in serverless contexts to keep the request function alive after a response has been sent. Check whether your hosting platform supports this pattern, or one like it. For example, Vercel Edge Functions provide a compatible
waitUntil method. This method isn't required when deployed to a stateful Node.js server, because the server keeps running after the response has been returned.
createStorefrontClient API reference for the complete list of required and optional parameters.