@shopify/hydrogen 2025.7.0 → 2025.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/dev/{get-virtual-routes-KWSSQH4L.js → get-virtual-routes-ZEUPNZWL.js} +0 -36
  2. package/dist/dev/hydrogen-routes.js +1 -1
  3. package/dist/development/{get-virtual-routes-6PVSMJPH.js → get-virtual-routes-XE7G57DS.js} +3 -36
  4. package/dist/development/get-virtual-routes-XE7G57DS.js.map +1 -0
  5. package/dist/development/index.cjs +406 -124
  6. package/dist/development/index.cjs.map +1 -1
  7. package/dist/development/index.js +395 -81
  8. package/dist/development/index.js.map +1 -1
  9. package/dist/development/react-router-preset.d.ts +5 -5
  10. package/dist/development/react-router-preset.js +4 -4
  11. package/dist/development/react-router-preset.js.map +1 -1
  12. package/dist/oxygen/index.d.ts +120 -3
  13. package/dist/oxygen/index.js +111 -5
  14. package/dist/production/get-virtual-routes-MYYLGSAS.js +3 -0
  15. package/dist/production/get-virtual-routes-MYYLGSAS.js.map +1 -0
  16. package/dist/production/index.cjs +76 -76
  17. package/dist/production/index.cjs.map +1 -1
  18. package/dist/production/index.d.cts +76 -15
  19. package/dist/production/index.d.ts +76 -15
  20. package/dist/production/index.js +76 -76
  21. package/dist/production/index.js.map +1 -1
  22. package/dist/production/react-router-preset.d.ts +5 -5
  23. package/dist/production/react-router-preset.js +2 -2
  24. package/dist/vite/get-virtual-routes.d.ts +1 -17
  25. package/dist/vite/get-virtual-routes.js +0 -36
  26. package/package.json +6 -6
  27. package/dist/development/get-virtual-routes-6PVSMJPH.js.map +0 -1
  28. package/dist/oxygen/chunk-RVXKHOUX.js +0 -39
  29. package/dist/oxygen/chunk-T4YWBSCF.js +0 -14
  30. package/dist/oxygen/createRequestHandler.d.ts +0 -10
  31. package/dist/oxygen/createRequestHandler.js +0 -6
  32. package/dist/oxygen/getStorefrontHeaders-BqPh5S1b.d.ts +0 -69
  33. package/dist/oxygen/getStorefrontHeaders.d.ts +0 -1
  34. package/dist/oxygen/getStorefrontHeaders.js +0 -6
  35. package/dist/production/get-virtual-routes-JVKSNI4M.js +0 -3
  36. package/dist/production/get-virtual-routes-JVKSNI4M.js.map +0 -1
@@ -2,11 +2,11 @@ import * as react from 'react';
2
2
  import { ReactNode, ComponentType, ScriptHTMLAttributes, FC, ForwardRefExoticComponent, RefAttributes, ComponentProps } from 'react';
3
3
  import { BuyerInput, CountryCode as CountryCode$1, LanguageCode as LanguageCode$1, CartInput, CartLineInput, CartLineUpdateInput, CartBuyerIdentityInput, CartSelectedDeliveryOptionInput, AttributeInput, Scalars, CartSelectableAddressInput, CartSelectableAddressUpdateInput, Cart, CartMetafieldsSetInput, CartUserError, MetafieldsSetUserError, MetafieldDeleteUserError, CartWarning, Product, ProductVariant, CartLine, ComponentizableCartLine, CurrencyCode, PageInfo, Maybe, ProductOptionValue, SelectedOptionInput, ProductOption, ProductVariantConnection } from '@shopify/hydrogen-react/storefront-api-types';
4
4
  import { createStorefrontClient as createStorefrontClient$1, StorefrontClientProps, RichText as RichText$1, ShopPayButton as ShopPayButton$1 } from '@shopify/hydrogen-react';
5
- export { AnalyticsEventName, AnalyticsPageType, ClientBrowserParameters, ExternalVideo, IMAGE_FRAGMENT, Image, MappedProductOptions, MediaFile, ModelViewer, Money, ParsedMetafields, ShopifyAnalytics as SendShopifyAnalyticsEvent, ShopifyAddToCart, ShopifyAddToCartPayload, ShopifyAnalyticsPayload, ShopifyAnalyticsProduct, ShopifyCookies, ShopifyPageView, ShopifyPageViewPayload, ShopifySalesChannel, StorefrontApiResponse, StorefrontApiResponseError, StorefrontApiResponseOk, StorefrontApiResponseOkPartial, StorefrontApiResponsePartial, Video, customerAccountApiCustomScalars, decodeEncodedVariant, flattenConnection, getAdjacentAndFirstAvailableVariants, getClientBrowserParameters, getProductOptions, getShopifyCookies, isOptionValueCombinationInEncodedVariant, mapSelectedProductOptionToObject, parseGid, parseMetafield, sendShopifyAnalytics, storefrontApiCustomScalars, useLoadScript, useMoney, useSelectedOptionInUrlParam, useShopifyCookies } from '@shopify/hydrogen-react';
5
+ export { AnalyticsEventName, AnalyticsPageType, ClientBrowserParameters, ExternalVideo, IMAGE_FRAGMENT, Image, MappedProductOptions, MediaFile, ModelViewer, Money, ParsedMetafields, ShopifyAnalytics as SendShopifyAnalyticsEvent, ShopifyAddToCart, ShopifyAddToCartPayload, ShopifyAnalyticsPayload, ShopifyAnalyticsProduct, ShopifyCookies, ShopifyPageView, ShopifyPageViewPayload, ShopifySalesChannel, StorefrontApiResponse, StorefrontApiResponseError, StorefrontApiResponseOk, StorefrontApiResponseOkPartial, StorefrontApiResponsePartial, Video, customerAccountApiCustomScalars, decodeEncodedVariant, flattenConnection, getAdjacentAndFirstAvailableVariants, getClientBrowserParameters, getProductOptions, getShopifyCookies, getTrackingValues, isOptionValueCombinationInEncodedVariant, mapSelectedProductOptionToObject, parseGid, parseMetafield, sendShopifyAnalytics, storefrontApiCustomScalars, useLoadScript, useMoney, useSelectedOptionInUrlParam, useShopifyCookies } from '@shopify/hydrogen-react';
6
6
  import { LanguageCode, CountryCode } from '@shopify/hydrogen-react/customer-account-api-types';
7
7
  import { ExecutionArgs } from 'graphql';
8
8
  import * as react_router from 'react-router';
9
- import { SessionData, FlashSessionData, Session, SessionStorage, RouterContextProvider, FetcherWithComponents, LinkProps, LoaderFunctionArgs, MetaFunction, LoaderFunction, Params, Location } from 'react-router';
9
+ import { SessionData, FlashSessionData, Session, SessionStorage, RouterContextProvider, FetcherWithComponents, ServerBuild, LinkProps, LoaderFunctionArgs, MetaFunction, LoaderFunction, Params, Location } from 'react-router';
10
10
  import * as react_jsx_runtime from 'react/jsx-runtime';
11
11
  import { PartialDeep } from 'type-fest';
12
12
  import { RouteConfigEntry } from '@react-router/dev/routes';
@@ -603,6 +603,8 @@ interface CustomerAccountMutations {
603
603
  type LoginOptions = {
604
604
  uiLocales?: LanguageCode;
605
605
  countryCode?: CountryCode;
606
+ acrValues?: string;
607
+ loginHint?: string;
606
608
  };
607
609
  type LogoutOptions = {
608
610
  /** The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev. */
@@ -1032,9 +1034,11 @@ type StorefrontHeaders = {
1032
1034
  requestGroupId: string | null;
1033
1035
  /** The IP address of the client. */
1034
1036
  buyerIp: string | null;
1037
+ /** The signature of the client's IP address for verification. */
1038
+ buyerIpSig: string | null;
1035
1039
  /** The cookie header from the client */
1036
1040
  cookie: string | null;
1037
- /** The purpose header value for debugging */
1041
+ /** The sec-purpose or purpose header value */
1038
1042
  purpose: string | null;
1039
1043
  };
1040
1044
 
@@ -1132,6 +1136,26 @@ type Storefront<TI18n extends I18nBase = I18nBase> = {
1132
1136
  getShopifyDomain: ReturnType<typeof createStorefrontClient$1>['getShopifyDomain'];
1133
1137
  getApiUrl: ReturnType<typeof createStorefrontClient$1>['getStorefrontApiUrl'];
1134
1138
  i18n: TI18n;
1139
+ getHeaders: () => Record<string, string>;
1140
+ /**
1141
+ * Checks if the request URL matches the Storefront API GraphQL endpoint.
1142
+ */
1143
+ isStorefrontApiUrl: (request: {
1144
+ url?: string;
1145
+ }) => boolean;
1146
+ /**
1147
+ * Forwards the request to the Storefront API.
1148
+ * It reads the API version from the request URL.
1149
+ */
1150
+ forward: (request: Request, options?: Pick<StorefrontCommonExtraParams, 'storefrontApiVersion'>) => Promise<Response>;
1151
+ /**
1152
+ * Sets the collected subrequest headers in the response.
1153
+ * Useful to forward the cookies and server-timing headers
1154
+ * from server subrequests to the browser.
1155
+ */
1156
+ setCollectedSubrequestHeaders: (response: {
1157
+ headers: Headers;
1158
+ }) => void;
1135
1159
  };
1136
1160
  type HydrogenClientProps<TI18n> = {
1137
1161
  /** Storefront API headers. If on Oxygen, use `getStorefrontHeaders()` */
@@ -1409,18 +1433,13 @@ type SetConsentHeadlessParams = VisitorConsent & CustomerPrivacyConsentConfig &
1409
1433
  doesMerchantSupportGranularConsent
1410
1434
  firstPartyMarketingAllowed
1411
1435
  getCCPAConsent
1412
- getRegulation
1413
- getShopPrefs
1414
1436
  getTrackingConsent
1415
- isRegulationEnforced
1416
1437
  marketingAllowed
1417
1438
  preferencesProcessingAllowed
1418
1439
  saleOfDataAllowed
1419
1440
  saleOfDataRegion
1420
- setCCPAConsent
1421
1441
  setTrackingConsent
1422
1442
  shouldShowBanner
1423
- shouldShowCCPABanner
1424
1443
  shouldShowGDPRBanner
1425
1444
  thirdPartyMarketingAllowed
1426
1445
  **/
@@ -1433,6 +1452,7 @@ type OriginalCustomerPrivacy = {
1433
1452
  setTrackingConsent: (consent: SetConsentHeadlessParams, callback: (data: {
1434
1453
  error: string;
1435
1454
  } | undefined) => void) => void;
1455
+ shouldShowBanner: () => boolean;
1436
1456
  };
1437
1457
  type CustomerPrivacy$1 = Omit<OriginalCustomerPrivacy, 'setTrackingConsent'> & {
1438
1458
  setTrackingConsent: (consent: VisitorConsent, // we have already applied the headlessStorefront in the override
@@ -1463,6 +1483,11 @@ type CustomerPrivacyApiProps = {
1463
1483
  onVisitorConsentCollected?: (consent: VisitorConsentCollected) => void;
1464
1484
  /** Callback to be call when customer privacy api is ready. */
1465
1485
  onReady?: () => void;
1486
+ /**
1487
+ * Whether consent libraries can use same-domain requests to the Storefront API.
1488
+ * Defaults to true if the standard route proxy is enabled in Hydrogen server.
1489
+ */
1490
+ sameDomainForStorefrontApi?: boolean;
1466
1491
  };
1467
1492
  declare function useCustomerPrivacy(props: CustomerPrivacyApiProps): {
1468
1493
  customerPrivacy: CustomerPrivacy$1 | null;
@@ -1479,7 +1504,7 @@ type ShopAnalytics = {
1479
1504
  /** The Hydrogen subchannel ID generated by Oxygen in the environment variable. */
1480
1505
  hydrogenSubchannelId: string | '0';
1481
1506
  };
1482
- type Consent = Partial<Pick<CustomerPrivacyApiProps, 'checkoutDomain' | 'storefrontAccessToken' | 'withPrivacyBanner' | 'country'>> & {
1507
+ type Consent = Partial<Pick<CustomerPrivacyApiProps, 'checkoutDomain' | 'sameDomainForStorefrontApi' | 'storefrontAccessToken' | 'withPrivacyBanner' | 'country'>> & {
1483
1508
  language?: LanguageCode$1;
1484
1509
  };
1485
1510
  type AnalyticsProviderProps = {
@@ -2038,6 +2063,42 @@ interface HydrogenContext<TSession extends HydrogenSession = HydrogenSession, TC
2038
2063
  }
2039
2064
  declare function createHydrogenContext<TSession extends HydrogenSession, TCustomMethods extends CustomMethodsBase | undefined = {}, TI18n extends I18nBase = I18nBase, TEnv extends HydrogenEnv = Env, TAdditionalContext extends Record<string, any> = {}>(options: HydrogenContextOptions<TSession, TCustomMethods, TI18n, TEnv>, additionalContext?: TAdditionalContext): HydrogenRouterContextProvider<TSession, TCustomMethods, TI18n, TEnv> & TAdditionalContext;
2040
2065
 
2066
+ type CreateRequestHandlerOptions<Context = unknown> = {
2067
+ /** React Router's server build */
2068
+ build: ServerBuild;
2069
+ /** React Router's mode */
2070
+ mode?: string;
2071
+ /**
2072
+ * Function to provide the load context for each request.
2073
+ * It must contain Hydrogen's storefront client instance
2074
+ * for other Hydrogen utilities to work properly.
2075
+ */
2076
+ getLoadContext?: (request: Request) => Promise<Context> | Context;
2077
+ /**
2078
+ * Whether to include the `powered-by` header in responses
2079
+ * @default true
2080
+ */
2081
+ poweredByHeader?: boolean;
2082
+ /**
2083
+ * Collect tracking information from subrequests such as cookies
2084
+ * and forward them to the browser. Disable this if you are not
2085
+ * using Hydrogen's built-in analytics.
2086
+ * @default true
2087
+ */
2088
+ collectTrackingInformation?: boolean;
2089
+ /**
2090
+ * Whether to proxy standard routes such as `/api/.../graphql.json` (Storefront API).
2091
+ * You can disable this if you are handling these routes yourself. Ensure that
2092
+ * the proxy works if you rely on Hydrogen's built-in behaviors such as analytics.
2093
+ * @default true
2094
+ */
2095
+ proxyStandardRoutes?: boolean;
2096
+ };
2097
+ /**
2098
+ * Creates a request handler for Hydrogen apps using React Router.
2099
+ */
2100
+ declare function createRequestHandler<Context = unknown>({ build, mode, poweredByHeader, getLoadContext, collectTrackingInformation, proxyStandardRoutes, }: CreateRequestHandlerOptions<Context>): (request: Request) => Promise<Response>;
2101
+
2041
2102
  declare const NonceProvider: react.Provider<string | undefined>;
2042
2103
  declare const useNonce: () => string | undefined;
2043
2104
  type ContentSecurityPolicy = {
@@ -2286,12 +2347,12 @@ type GetSelectedProductOptions = (request: Request) => SelectedOptionInput[];
2286
2347
  declare const getSelectedProductOptions: GetSelectedProductOptions;
2287
2348
 
2288
2349
  /**
2289
- * Official Hydrogen Preset for React Router 7.9.x
2350
+ * Official Hydrogen Preset for React Router 7.12.x
2290
2351
  *
2291
2352
  * Provides optimal React Router configuration for Hydrogen applications on Oxygen.
2292
2353
  * Enables validated performance optimizations while ensuring CLI compatibility.
2293
2354
  *
2294
- * React Router 7.9.x Feature Support Matrix for Hydrogen 2025.7.0
2355
+ * React Router 7.12.x Feature Support Matrix for Hydrogen 2025.7.0
2295
2356
  *
2296
2357
  * +----------------------------------+----------+----------------------------------+
2297
2358
  * | Feature | Status | Notes |
@@ -2304,9 +2365,9 @@ declare const getSelectedProductOptions: GetSelectedProductOptions;
2304
2365
  * +----------------------------------+----------+----------------------------------+
2305
2366
  * | PERFORMANCE FLAGS |
2306
2367
  * +----------------------------------+----------+----------------------------------+
2307
- * | unstable_optimizeDeps | Enabled | Build performance optimization |
2308
2368
  * | v8_middleware | Enabled | Required for Hydrogen context |
2309
- * | unstable_splitRouteModules | Enabled | Route code splitting |
2369
+ * | v8_splitRouteModules | Enabled | Route code splitting |
2370
+ * | unstable_optimizeDeps | Enabled | Build performance optimization |
2310
2371
  * +----------------------------------+----------+----------------------------------+
2311
2372
  * | ROUTE DISCOVERY |
2312
2373
  * +----------------------------------+----------+----------------------------------+
@@ -2320,7 +2381,7 @@ declare const getSelectedProductOptions: GetSelectedProductOptions;
2320
2381
  * | serverBundles: () => {} | Blocked | Manifest incompatibility |
2321
2382
  * | buildEnd: () => {} | Blocked | CLI bypasses hook execution |
2322
2383
  * | unstable_subResourceIntegrity | Blocked | CSP nonce/hash conflict |
2323
- * | unstable_viteEnvironmentApi | Blocked | CLI fallback detection used |
2384
+ * | v8_viteEnvironmentApi | Blocked | CLI fallback detection used |
2324
2385
  * +----------------------------------+----------+----------------------------------+
2325
2386
  *
2326
2387
  * @version 2025.7.0
@@ -2693,4 +2754,4 @@ interface GetSiteMapOptions {
2693
2754
  */
2694
2755
  declare function getSitemap(options: GetSiteMapOptions): Promise<Response>;
2695
2756
 
2696
- export { Analytics, AnalyticsEvent, CacheCustom, type CacheKey, CacheLong, CacheNone, CacheShort, type CachingStrategy, type CartActionInput, CartForm, type CartLineUpdatePayload, type CartQueryDataReturn, type CartQueryOptions, type CartQueryReturn, type CartReturn, type CartUpdatePayload, type CartViewPayload, type CollectionViewPayload, type ConsentStatus, type CookieOptions, type CreateStorefrontClientForDocs, type CreateStorefrontClientOptions, type CustomEventMap$1 as CustomEventMap, type CustomerAccount, type CustomerAccountMutations, type CustomerAccountQueries, type CustomerPrivacy$1 as CustomerPrivacy, type CustomerPrivacyApiProps, type CustomerPrivacyConsentConfig, type HydrogenCart, type HydrogenCartCustom, type HydrogenContext, type HydrogenEnv, type HydrogenRouterContextProvider, type HydrogenSession, type HydrogenSessionData, type I18nBase, InMemoryCache, type MetafieldWithoutOwnerId, type NoStoreStrategy, NonceProvider, type OptimisticCart, type OptimisticCartLine, type OptimisticCartLineInput, OptimisticInput, type PageViewPayload, Pagination, type PrivacyBanner$1 as PrivacyBanner, type ProductViewPayload, RichText, Script, type SearchViewPayload, Seo, type SeoConfig, type SeoHandleFunction, type SetConsentHeadlessParams, type ShopAnalytics, ShopPayButton, type Storefront, type StorefrontApiErrors, type StorefrontClient, type StorefrontForDoc, type StorefrontMutationOptionsForDocs, type StorefrontMutations, type StorefrontQueries, type StorefrontQueryOptionsForDocs, type VariantOption, type VariantOptionValue, VariantSelector, type VisitorConsent, type VisitorConsentCollected, type WithCache, cartAttributesUpdateDefault, cartBuyerIdentityUpdateDefault, cartCreateDefault, cartDiscountCodesUpdateDefault, cartGetDefault, cartGetIdDefault, cartGiftCardCodesRemoveDefault, cartGiftCardCodesUpdateDefault, cartLinesAddDefault, cartLinesRemoveDefault, cartLinesUpdateDefault, cartMetafieldDeleteDefault, cartMetafieldsSetDefault, cartNoteUpdateDefault, cartSelectedDeliveryOptionsUpdateDefault, cartSetIdDefault, changelogHandler, createCartHandler, createContentSecurityPolicy, createCustomerAccountClient, createHydrogenContext, createStorefrontClient, createWithCache, formatAPIResult, generateCacheControlHeader, getPaginationVariables, getSelectedProductOptions, getSeoMeta, getShopAnalytics, getSitemap, getSitemapIndex, graphiqlLoader, hydrogenContext, hydrogenPreset, hydrogenRoutes, storefrontRedirect, useAnalytics, useCustomerPrivacy, useNonce, useOptimisticCart, useOptimisticData, useOptimisticVariant };
2757
+ export { Analytics, AnalyticsEvent, CacheCustom, type CacheKey, CacheLong, CacheNone, CacheShort, type CachingStrategy, type CartActionInput, CartForm, type CartLineUpdatePayload, type CartQueryDataReturn, type CartQueryOptions, type CartQueryReturn, type CartReturn, type CartUpdatePayload, type CartViewPayload, type CollectionViewPayload, type ConsentStatus, type CookieOptions, type CreateStorefrontClientForDocs, type CreateStorefrontClientOptions, type CustomEventMap$1 as CustomEventMap, type CustomerAccount, type CustomerAccountMutations, type CustomerAccountQueries, type CustomerPrivacy$1 as CustomerPrivacy, type CustomerPrivacyApiProps, type CustomerPrivacyConsentConfig, type HydrogenCart, type HydrogenCartCustom, type HydrogenContext, type HydrogenEnv, type HydrogenRouterContextProvider, type HydrogenSession, type HydrogenSessionData, type I18nBase, InMemoryCache, type MetafieldWithoutOwnerId, type NoStoreStrategy, NonceProvider, type OptimisticCart, type OptimisticCartLine, type OptimisticCartLineInput, OptimisticInput, type PageViewPayload, Pagination, type PrivacyBanner$1 as PrivacyBanner, type ProductViewPayload, RichText, Script, type SearchViewPayload, Seo, type SeoConfig, type SeoHandleFunction, type SetConsentHeadlessParams, type ShopAnalytics, ShopPayButton, type Storefront, type StorefrontApiErrors, type StorefrontClient, type StorefrontForDoc, type StorefrontMutationOptionsForDocs, type StorefrontMutations, type StorefrontQueries, type StorefrontQueryOptionsForDocs, type VariantOption, type VariantOptionValue, VariantSelector, type VisitorConsent, type VisitorConsentCollected, type WithCache, cartAttributesUpdateDefault, cartBuyerIdentityUpdateDefault, cartCreateDefault, cartDiscountCodesUpdateDefault, cartGetDefault, cartGetIdDefault, cartGiftCardCodesRemoveDefault, cartGiftCardCodesUpdateDefault, cartLinesAddDefault, cartLinesRemoveDefault, cartLinesUpdateDefault, cartMetafieldDeleteDefault, cartMetafieldsSetDefault, cartNoteUpdateDefault, cartSelectedDeliveryOptionsUpdateDefault, cartSetIdDefault, changelogHandler, createCartHandler, createContentSecurityPolicy, createCustomerAccountClient, createHydrogenContext, createRequestHandler, createStorefrontClient, createWithCache, formatAPIResult, generateCacheControlHeader, getPaginationVariables, getSelectedProductOptions, getSeoMeta, getShopAnalytics, getSitemap, getSitemapIndex, graphiqlLoader, hydrogenContext, hydrogenPreset, hydrogenRoutes, storefrontRedirect, useAnalytics, useCustomerPrivacy, useNonce, useOptimisticCart, useOptimisticData, useOptimisticVariant };
@@ -2,11 +2,11 @@ import * as react from 'react';
2
2
  import { ReactNode, ComponentType, ScriptHTMLAttributes, FC, ForwardRefExoticComponent, RefAttributes, ComponentProps } from 'react';
3
3
  import { BuyerInput, CountryCode as CountryCode$1, LanguageCode as LanguageCode$1, CartInput, CartLineInput, CartLineUpdateInput, CartBuyerIdentityInput, CartSelectedDeliveryOptionInput, AttributeInput, Scalars, CartSelectableAddressInput, CartSelectableAddressUpdateInput, Cart, CartMetafieldsSetInput, CartUserError, MetafieldsSetUserError, MetafieldDeleteUserError, CartWarning, Product, ProductVariant, CartLine, ComponentizableCartLine, CurrencyCode, PageInfo, Maybe, ProductOptionValue, SelectedOptionInput, ProductOption, ProductVariantConnection } from '@shopify/hydrogen-react/storefront-api-types';
4
4
  import { createStorefrontClient as createStorefrontClient$1, StorefrontClientProps, RichText as RichText$1, ShopPayButton as ShopPayButton$1 } from '@shopify/hydrogen-react';
5
- export { AnalyticsEventName, AnalyticsPageType, ClientBrowserParameters, ExternalVideo, IMAGE_FRAGMENT, Image, MappedProductOptions, MediaFile, ModelViewer, Money, ParsedMetafields, ShopifyAnalytics as SendShopifyAnalyticsEvent, ShopifyAddToCart, ShopifyAddToCartPayload, ShopifyAnalyticsPayload, ShopifyAnalyticsProduct, ShopifyCookies, ShopifyPageView, ShopifyPageViewPayload, ShopifySalesChannel, StorefrontApiResponse, StorefrontApiResponseError, StorefrontApiResponseOk, StorefrontApiResponseOkPartial, StorefrontApiResponsePartial, Video, customerAccountApiCustomScalars, decodeEncodedVariant, flattenConnection, getAdjacentAndFirstAvailableVariants, getClientBrowserParameters, getProductOptions, getShopifyCookies, isOptionValueCombinationInEncodedVariant, mapSelectedProductOptionToObject, parseGid, parseMetafield, sendShopifyAnalytics, storefrontApiCustomScalars, useLoadScript, useMoney, useSelectedOptionInUrlParam, useShopifyCookies } from '@shopify/hydrogen-react';
5
+ export { AnalyticsEventName, AnalyticsPageType, ClientBrowserParameters, ExternalVideo, IMAGE_FRAGMENT, Image, MappedProductOptions, MediaFile, ModelViewer, Money, ParsedMetafields, ShopifyAnalytics as SendShopifyAnalyticsEvent, ShopifyAddToCart, ShopifyAddToCartPayload, ShopifyAnalyticsPayload, ShopifyAnalyticsProduct, ShopifyCookies, ShopifyPageView, ShopifyPageViewPayload, ShopifySalesChannel, StorefrontApiResponse, StorefrontApiResponseError, StorefrontApiResponseOk, StorefrontApiResponseOkPartial, StorefrontApiResponsePartial, Video, customerAccountApiCustomScalars, decodeEncodedVariant, flattenConnection, getAdjacentAndFirstAvailableVariants, getClientBrowserParameters, getProductOptions, getShopifyCookies, getTrackingValues, isOptionValueCombinationInEncodedVariant, mapSelectedProductOptionToObject, parseGid, parseMetafield, sendShopifyAnalytics, storefrontApiCustomScalars, useLoadScript, useMoney, useSelectedOptionInUrlParam, useShopifyCookies } from '@shopify/hydrogen-react';
6
6
  import { LanguageCode, CountryCode } from '@shopify/hydrogen-react/customer-account-api-types';
7
7
  import { ExecutionArgs } from 'graphql';
8
8
  import * as react_router from 'react-router';
9
- import { SessionData, FlashSessionData, Session, SessionStorage, RouterContextProvider, FetcherWithComponents, LinkProps, LoaderFunctionArgs, MetaFunction, LoaderFunction, Params, Location } from 'react-router';
9
+ import { SessionData, FlashSessionData, Session, SessionStorage, RouterContextProvider, FetcherWithComponents, ServerBuild, LinkProps, LoaderFunctionArgs, MetaFunction, LoaderFunction, Params, Location } from 'react-router';
10
10
  import * as react_jsx_runtime from 'react/jsx-runtime';
11
11
  import { PartialDeep } from 'type-fest';
12
12
  import { RouteConfigEntry } from '@react-router/dev/routes';
@@ -603,6 +603,8 @@ interface CustomerAccountMutations {
603
603
  type LoginOptions = {
604
604
  uiLocales?: LanguageCode;
605
605
  countryCode?: CountryCode;
606
+ acrValues?: string;
607
+ loginHint?: string;
606
608
  };
607
609
  type LogoutOptions = {
608
610
  /** The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev. */
@@ -1032,9 +1034,11 @@ type StorefrontHeaders = {
1032
1034
  requestGroupId: string | null;
1033
1035
  /** The IP address of the client. */
1034
1036
  buyerIp: string | null;
1037
+ /** The signature of the client's IP address for verification. */
1038
+ buyerIpSig: string | null;
1035
1039
  /** The cookie header from the client */
1036
1040
  cookie: string | null;
1037
- /** The purpose header value for debugging */
1041
+ /** The sec-purpose or purpose header value */
1038
1042
  purpose: string | null;
1039
1043
  };
1040
1044
 
@@ -1132,6 +1136,26 @@ type Storefront<TI18n extends I18nBase = I18nBase> = {
1132
1136
  getShopifyDomain: ReturnType<typeof createStorefrontClient$1>['getShopifyDomain'];
1133
1137
  getApiUrl: ReturnType<typeof createStorefrontClient$1>['getStorefrontApiUrl'];
1134
1138
  i18n: TI18n;
1139
+ getHeaders: () => Record<string, string>;
1140
+ /**
1141
+ * Checks if the request URL matches the Storefront API GraphQL endpoint.
1142
+ */
1143
+ isStorefrontApiUrl: (request: {
1144
+ url?: string;
1145
+ }) => boolean;
1146
+ /**
1147
+ * Forwards the request to the Storefront API.
1148
+ * It reads the API version from the request URL.
1149
+ */
1150
+ forward: (request: Request, options?: Pick<StorefrontCommonExtraParams, 'storefrontApiVersion'>) => Promise<Response>;
1151
+ /**
1152
+ * Sets the collected subrequest headers in the response.
1153
+ * Useful to forward the cookies and server-timing headers
1154
+ * from server subrequests to the browser.
1155
+ */
1156
+ setCollectedSubrequestHeaders: (response: {
1157
+ headers: Headers;
1158
+ }) => void;
1135
1159
  };
1136
1160
  type HydrogenClientProps<TI18n> = {
1137
1161
  /** Storefront API headers. If on Oxygen, use `getStorefrontHeaders()` */
@@ -1409,18 +1433,13 @@ type SetConsentHeadlessParams = VisitorConsent & CustomerPrivacyConsentConfig &
1409
1433
  doesMerchantSupportGranularConsent
1410
1434
  firstPartyMarketingAllowed
1411
1435
  getCCPAConsent
1412
- getRegulation
1413
- getShopPrefs
1414
1436
  getTrackingConsent
1415
- isRegulationEnforced
1416
1437
  marketingAllowed
1417
1438
  preferencesProcessingAllowed
1418
1439
  saleOfDataAllowed
1419
1440
  saleOfDataRegion
1420
- setCCPAConsent
1421
1441
  setTrackingConsent
1422
1442
  shouldShowBanner
1423
- shouldShowCCPABanner
1424
1443
  shouldShowGDPRBanner
1425
1444
  thirdPartyMarketingAllowed
1426
1445
  **/
@@ -1433,6 +1452,7 @@ type OriginalCustomerPrivacy = {
1433
1452
  setTrackingConsent: (consent: SetConsentHeadlessParams, callback: (data: {
1434
1453
  error: string;
1435
1454
  } | undefined) => void) => void;
1455
+ shouldShowBanner: () => boolean;
1436
1456
  };
1437
1457
  type CustomerPrivacy$1 = Omit<OriginalCustomerPrivacy, 'setTrackingConsent'> & {
1438
1458
  setTrackingConsent: (consent: VisitorConsent, // we have already applied the headlessStorefront in the override
@@ -1463,6 +1483,11 @@ type CustomerPrivacyApiProps = {
1463
1483
  onVisitorConsentCollected?: (consent: VisitorConsentCollected) => void;
1464
1484
  /** Callback to be call when customer privacy api is ready. */
1465
1485
  onReady?: () => void;
1486
+ /**
1487
+ * Whether consent libraries can use same-domain requests to the Storefront API.
1488
+ * Defaults to true if the standard route proxy is enabled in Hydrogen server.
1489
+ */
1490
+ sameDomainForStorefrontApi?: boolean;
1466
1491
  };
1467
1492
  declare function useCustomerPrivacy(props: CustomerPrivacyApiProps): {
1468
1493
  customerPrivacy: CustomerPrivacy$1 | null;
@@ -1479,7 +1504,7 @@ type ShopAnalytics = {
1479
1504
  /** The Hydrogen subchannel ID generated by Oxygen in the environment variable. */
1480
1505
  hydrogenSubchannelId: string | '0';
1481
1506
  };
1482
- type Consent = Partial<Pick<CustomerPrivacyApiProps, 'checkoutDomain' | 'storefrontAccessToken' | 'withPrivacyBanner' | 'country'>> & {
1507
+ type Consent = Partial<Pick<CustomerPrivacyApiProps, 'checkoutDomain' | 'sameDomainForStorefrontApi' | 'storefrontAccessToken' | 'withPrivacyBanner' | 'country'>> & {
1483
1508
  language?: LanguageCode$1;
1484
1509
  };
1485
1510
  type AnalyticsProviderProps = {
@@ -2038,6 +2063,42 @@ interface HydrogenContext<TSession extends HydrogenSession = HydrogenSession, TC
2038
2063
  }
2039
2064
  declare function createHydrogenContext<TSession extends HydrogenSession, TCustomMethods extends CustomMethodsBase | undefined = {}, TI18n extends I18nBase = I18nBase, TEnv extends HydrogenEnv = Env, TAdditionalContext extends Record<string, any> = {}>(options: HydrogenContextOptions<TSession, TCustomMethods, TI18n, TEnv>, additionalContext?: TAdditionalContext): HydrogenRouterContextProvider<TSession, TCustomMethods, TI18n, TEnv> & TAdditionalContext;
2040
2065
 
2066
+ type CreateRequestHandlerOptions<Context = unknown> = {
2067
+ /** React Router's server build */
2068
+ build: ServerBuild;
2069
+ /** React Router's mode */
2070
+ mode?: string;
2071
+ /**
2072
+ * Function to provide the load context for each request.
2073
+ * It must contain Hydrogen's storefront client instance
2074
+ * for other Hydrogen utilities to work properly.
2075
+ */
2076
+ getLoadContext?: (request: Request) => Promise<Context> | Context;
2077
+ /**
2078
+ * Whether to include the `powered-by` header in responses
2079
+ * @default true
2080
+ */
2081
+ poweredByHeader?: boolean;
2082
+ /**
2083
+ * Collect tracking information from subrequests such as cookies
2084
+ * and forward them to the browser. Disable this if you are not
2085
+ * using Hydrogen's built-in analytics.
2086
+ * @default true
2087
+ */
2088
+ collectTrackingInformation?: boolean;
2089
+ /**
2090
+ * Whether to proxy standard routes such as `/api/.../graphql.json` (Storefront API).
2091
+ * You can disable this if you are handling these routes yourself. Ensure that
2092
+ * the proxy works if you rely on Hydrogen's built-in behaviors such as analytics.
2093
+ * @default true
2094
+ */
2095
+ proxyStandardRoutes?: boolean;
2096
+ };
2097
+ /**
2098
+ * Creates a request handler for Hydrogen apps using React Router.
2099
+ */
2100
+ declare function createRequestHandler<Context = unknown>({ build, mode, poweredByHeader, getLoadContext, collectTrackingInformation, proxyStandardRoutes, }: CreateRequestHandlerOptions<Context>): (request: Request) => Promise<Response>;
2101
+
2041
2102
  declare const NonceProvider: react.Provider<string | undefined>;
2042
2103
  declare const useNonce: () => string | undefined;
2043
2104
  type ContentSecurityPolicy = {
@@ -2286,12 +2347,12 @@ type GetSelectedProductOptions = (request: Request) => SelectedOptionInput[];
2286
2347
  declare const getSelectedProductOptions: GetSelectedProductOptions;
2287
2348
 
2288
2349
  /**
2289
- * Official Hydrogen Preset for React Router 7.9.x
2350
+ * Official Hydrogen Preset for React Router 7.12.x
2290
2351
  *
2291
2352
  * Provides optimal React Router configuration for Hydrogen applications on Oxygen.
2292
2353
  * Enables validated performance optimizations while ensuring CLI compatibility.
2293
2354
  *
2294
- * React Router 7.9.x Feature Support Matrix for Hydrogen 2025.7.0
2355
+ * React Router 7.12.x Feature Support Matrix for Hydrogen 2025.7.0
2295
2356
  *
2296
2357
  * +----------------------------------+----------+----------------------------------+
2297
2358
  * | Feature | Status | Notes |
@@ -2304,9 +2365,9 @@ declare const getSelectedProductOptions: GetSelectedProductOptions;
2304
2365
  * +----------------------------------+----------+----------------------------------+
2305
2366
  * | PERFORMANCE FLAGS |
2306
2367
  * +----------------------------------+----------+----------------------------------+
2307
- * | unstable_optimizeDeps | Enabled | Build performance optimization |
2308
2368
  * | v8_middleware | Enabled | Required for Hydrogen context |
2309
- * | unstable_splitRouteModules | Enabled | Route code splitting |
2369
+ * | v8_splitRouteModules | Enabled | Route code splitting |
2370
+ * | unstable_optimizeDeps | Enabled | Build performance optimization |
2310
2371
  * +----------------------------------+----------+----------------------------------+
2311
2372
  * | ROUTE DISCOVERY |
2312
2373
  * +----------------------------------+----------+----------------------------------+
@@ -2320,7 +2381,7 @@ declare const getSelectedProductOptions: GetSelectedProductOptions;
2320
2381
  * | serverBundles: () => {} | Blocked | Manifest incompatibility |
2321
2382
  * | buildEnd: () => {} | Blocked | CLI bypasses hook execution |
2322
2383
  * | unstable_subResourceIntegrity | Blocked | CSP nonce/hash conflict |
2323
- * | unstable_viteEnvironmentApi | Blocked | CLI fallback detection used |
2384
+ * | v8_viteEnvironmentApi | Blocked | CLI fallback detection used |
2324
2385
  * +----------------------------------+----------+----------------------------------+
2325
2386
  *
2326
2387
  * @version 2025.7.0
@@ -2693,4 +2754,4 @@ interface GetSiteMapOptions {
2693
2754
  */
2694
2755
  declare function getSitemap(options: GetSiteMapOptions): Promise<Response>;
2695
2756
 
2696
- export { Analytics, AnalyticsEvent, CacheCustom, type CacheKey, CacheLong, CacheNone, CacheShort, type CachingStrategy, type CartActionInput, CartForm, type CartLineUpdatePayload, type CartQueryDataReturn, type CartQueryOptions, type CartQueryReturn, type CartReturn, type CartUpdatePayload, type CartViewPayload, type CollectionViewPayload, type ConsentStatus, type CookieOptions, type CreateStorefrontClientForDocs, type CreateStorefrontClientOptions, type CustomEventMap$1 as CustomEventMap, type CustomerAccount, type CustomerAccountMutations, type CustomerAccountQueries, type CustomerPrivacy$1 as CustomerPrivacy, type CustomerPrivacyApiProps, type CustomerPrivacyConsentConfig, type HydrogenCart, type HydrogenCartCustom, type HydrogenContext, type HydrogenEnv, type HydrogenRouterContextProvider, type HydrogenSession, type HydrogenSessionData, type I18nBase, InMemoryCache, type MetafieldWithoutOwnerId, type NoStoreStrategy, NonceProvider, type OptimisticCart, type OptimisticCartLine, type OptimisticCartLineInput, OptimisticInput, type PageViewPayload, Pagination, type PrivacyBanner$1 as PrivacyBanner, type ProductViewPayload, RichText, Script, type SearchViewPayload, Seo, type SeoConfig, type SeoHandleFunction, type SetConsentHeadlessParams, type ShopAnalytics, ShopPayButton, type Storefront, type StorefrontApiErrors, type StorefrontClient, type StorefrontForDoc, type StorefrontMutationOptionsForDocs, type StorefrontMutations, type StorefrontQueries, type StorefrontQueryOptionsForDocs, type VariantOption, type VariantOptionValue, VariantSelector, type VisitorConsent, type VisitorConsentCollected, type WithCache, cartAttributesUpdateDefault, cartBuyerIdentityUpdateDefault, cartCreateDefault, cartDiscountCodesUpdateDefault, cartGetDefault, cartGetIdDefault, cartGiftCardCodesRemoveDefault, cartGiftCardCodesUpdateDefault, cartLinesAddDefault, cartLinesRemoveDefault, cartLinesUpdateDefault, cartMetafieldDeleteDefault, cartMetafieldsSetDefault, cartNoteUpdateDefault, cartSelectedDeliveryOptionsUpdateDefault, cartSetIdDefault, changelogHandler, createCartHandler, createContentSecurityPolicy, createCustomerAccountClient, createHydrogenContext, createStorefrontClient, createWithCache, formatAPIResult, generateCacheControlHeader, getPaginationVariables, getSelectedProductOptions, getSeoMeta, getShopAnalytics, getSitemap, getSitemapIndex, graphiqlLoader, hydrogenContext, hydrogenPreset, hydrogenRoutes, storefrontRedirect, useAnalytics, useCustomerPrivacy, useNonce, useOptimisticCart, useOptimisticData, useOptimisticVariant };
2757
+ export { Analytics, AnalyticsEvent, CacheCustom, type CacheKey, CacheLong, CacheNone, CacheShort, type CachingStrategy, type CartActionInput, CartForm, type CartLineUpdatePayload, type CartQueryDataReturn, type CartQueryOptions, type CartQueryReturn, type CartReturn, type CartUpdatePayload, type CartViewPayload, type CollectionViewPayload, type ConsentStatus, type CookieOptions, type CreateStorefrontClientForDocs, type CreateStorefrontClientOptions, type CustomEventMap$1 as CustomEventMap, type CustomerAccount, type CustomerAccountMutations, type CustomerAccountQueries, type CustomerPrivacy$1 as CustomerPrivacy, type CustomerPrivacyApiProps, type CustomerPrivacyConsentConfig, type HydrogenCart, type HydrogenCartCustom, type HydrogenContext, type HydrogenEnv, type HydrogenRouterContextProvider, type HydrogenSession, type HydrogenSessionData, type I18nBase, InMemoryCache, type MetafieldWithoutOwnerId, type NoStoreStrategy, NonceProvider, type OptimisticCart, type OptimisticCartLine, type OptimisticCartLineInput, OptimisticInput, type PageViewPayload, Pagination, type PrivacyBanner$1 as PrivacyBanner, type ProductViewPayload, RichText, Script, type SearchViewPayload, Seo, type SeoConfig, type SeoHandleFunction, type SetConsentHeadlessParams, type ShopAnalytics, ShopPayButton, type Storefront, type StorefrontApiErrors, type StorefrontClient, type StorefrontForDoc, type StorefrontMutationOptionsForDocs, type StorefrontMutations, type StorefrontQueries, type StorefrontQueryOptionsForDocs, type VariantOption, type VariantOptionValue, VariantSelector, type VisitorConsent, type VisitorConsentCollected, type WithCache, cartAttributesUpdateDefault, cartBuyerIdentityUpdateDefault, cartCreateDefault, cartDiscountCodesUpdateDefault, cartGetDefault, cartGetIdDefault, cartGiftCardCodesRemoveDefault, cartGiftCardCodesUpdateDefault, cartLinesAddDefault, cartLinesRemoveDefault, cartLinesUpdateDefault, cartMetafieldDeleteDefault, cartMetafieldsSetDefault, cartNoteUpdateDefault, cartSelectedDeliveryOptionsUpdateDefault, cartSetIdDefault, changelogHandler, createCartHandler, createContentSecurityPolicy, createCustomerAccountClient, createHydrogenContext, createRequestHandler, createStorefrontClient, createWithCache, formatAPIResult, generateCacheControlHeader, getPaginationVariables, getSelectedProductOptions, getSeoMeta, getShopAnalytics, getSitemap, getSitemapIndex, graphiqlLoader, hydrogenContext, hydrogenPreset, hydrogenRoutes, storefrontRedirect, useAnalytics, useCustomerPrivacy, useNonce, useOptimisticCart, useOptimisticData, useOptimisticVariant };