Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/hydrogen/src/storefront.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ type HydrogenClientProps<TI18n> = {
};

export type CreateStorefrontClientOptions<TI18n extends I18nBase> =
HydrogenClientProps<TI18n> & StorefrontClientProps;
HydrogenClientProps<TI18n> & StorefrontClientProps & { cachePurgeKey?: string };

type StorefrontQueryOptions = StorefrontCommonExtraParams & {
query: string;
Expand Down Expand Up @@ -208,6 +208,7 @@ export function createStorefrontClient<TI18n extends I18nBase>(
i18n,
storefrontId,
logErrors = true,
cachePurgeKey,
...clientOptions
} = options;
const H2_PREFIX_WARN = '[h2:warn:createStorefrontClient] ';
Expand Down Expand Up @@ -310,6 +311,7 @@ export function createStorefrontClient<TI18n extends I18nBase>(
requestInit.method,
cacheKeyHeader,
requestInit.body,
cachePurgeKey
];

const [body, response] = await fetchWithServerCache(url, requestInit, {
Expand Down