Skip to content

Instantly share code, notes, and snippets.

View benjaminsehl's full-sized avatar
♾️

Benjamin Sehl benjaminsehl

♾️
View GitHub Profile
@benjaminsehl
benjaminsehl / $.tsx
Last active May 17, 2023 02:38
Hydrogen Proxy Route in Remix
const config = {
cacheControl: 'public, max-age=3600, stale-while-revalidate=86400', // Set to the amount of time you want to cache the page, in seconds
removeNoIndex: true, // Set to false if you want to respect robots noindex tags
updateCanonical: true, // Set to false if you want to respect canonical meta tags
ignoreRedirects: true, // Set to false if you aren't redirecting to Hydrogen in your theme
};
export async function loader({request, context}) {
const {
shop: {
import { CacheLong } from '@shopify/hydrogen';
interface Config {
cacheControl: string;
removeNoIndex: boolean;
updateCanonical: boolean;
ignoreRedirects: boolean;
}
const config: Config = {

Deploying Hydrogen on Alternative Hosting Runtimes

If you want to use Hydrogen but prefer not to use Oxygen, you can deploy Hydrogen to various hosting platforms that support Remix. This guide walks you through adapting your Hydrogen app for an alternative hosting runtime.

Note: While Hydrogen and Remix are designed to run on any platform, some features of Hydrogen rely on Oxygen's Workers platform and support for certain Web APIs like Cache. This is an advanced guide that covers the areas to consider when hosting Hydrogen apps on your own architecture, and assumes you are comfortable with using Remix's adapters or creating your own. The steps in this guide are not supported by Shopify.

Adapting Your Hydrogen App for an Alternative Hosting Runtime

To adapt your Hydrogen app for an alternative hosting runtime, follow these steps:

Launching Your Hydrogen Storefront

This guide will walk you through the process of launching your Hydrogen storefront on Shopify. Follow these steps to ensure a smooth transition and a successful launch.

Update your Notifications domain

Ensure that the domain associated with your transactional emails and notifications, found in /admin/settings/notifications, correctly points to the associated domain of your Hydrogen storefront. This ensures that customers receive accurate information in their email notifications.

Add Preferred Vanity Domain

This file has been truncated, but you can view the full file.
export const bundleKiller =
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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