@shopify/hydrogen-react 2026.4.0 → 2026.4.1

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 (263) hide show
  1. package/dist/browser-dev/AddToCartButton.mjs.map +1 -1
  2. package/dist/browser-dev/BuyNowButton.mjs.map +1 -1
  3. package/dist/browser-dev/CartCheckoutButton.mjs.map +1 -1
  4. package/dist/browser-dev/CartCost.mjs.map +1 -1
  5. package/dist/browser-dev/CartLineProvider.mjs.map +1 -1
  6. package/dist/browser-dev/CartLineQuantity.mjs.map +1 -1
  7. package/dist/browser-dev/CartLineQuantityAdjustButton.mjs.map +1 -1
  8. package/dist/browser-dev/CartProvider.mjs.map +1 -1
  9. package/dist/browser-dev/ExternalVideo.mjs.map +1 -1
  10. package/dist/browser-dev/Image.mjs.map +1 -1
  11. package/dist/browser-dev/MediaFile.mjs.map +1 -1
  12. package/dist/browser-dev/ModelViewer.mjs.map +1 -1
  13. package/dist/browser-dev/Money.mjs.map +1 -1
  14. package/dist/browser-dev/ProductPrice.mjs.map +1 -1
  15. package/dist/browser-dev/ProductProvider.mjs.map +1 -1
  16. package/dist/browser-dev/RichText.mjs.map +1 -1
  17. package/dist/browser-dev/ShopPayButton.mjs.map +1 -1
  18. package/dist/browser-dev/ShopifyProvider.mjs.map +1 -1
  19. package/dist/browser-dev/Video.mjs.map +1 -1
  20. package/dist/browser-dev/analytics-constants.mjs.map +1 -1
  21. package/dist/browser-dev/analytics-utils.mjs.map +1 -1
  22. package/dist/browser-dev/analytics.mjs.map +1 -1
  23. package/dist/browser-dev/cart-queries.mjs +43 -81
  24. package/dist/browser-dev/cart-queries.mjs.map +1 -1
  25. package/dist/browser-dev/codegen.helpers.mjs.map +1 -1
  26. package/dist/browser-dev/cookies-utils.mjs.map +1 -1
  27. package/dist/browser-dev/flatten-connection.mjs.map +1 -1
  28. package/dist/browser-dev/getProductOptions.mjs.map +1 -1
  29. package/dist/browser-dev/load-script.mjs.map +1 -1
  30. package/dist/browser-dev/optionValueDecoder.mjs.map +1 -1
  31. package/dist/browser-dev/packages/hydrogen-react/package.json.mjs +1 -1
  32. package/dist/browser-dev/parse-metafield.mjs.map +1 -1
  33. package/dist/browser-dev/storefront-client.mjs.map +1 -1
  34. package/dist/browser-dev/tracking-utils.mjs.map +1 -1
  35. package/dist/browser-dev/useMoney.mjs.map +1 -1
  36. package/dist/browser-dev/useSelectedOptionInUrlParam.mjs.map +1 -1
  37. package/dist/browser-dev/useShopifyCookies.mjs.map +1 -1
  38. package/dist/browser-prod/AddToCartButton.mjs.map +1 -1
  39. package/dist/browser-prod/BuyNowButton.mjs.map +1 -1
  40. package/dist/browser-prod/CartCheckoutButton.mjs.map +1 -1
  41. package/dist/browser-prod/CartCost.mjs.map +1 -1
  42. package/dist/browser-prod/CartLineProvider.mjs.map +1 -1
  43. package/dist/browser-prod/CartLineQuantity.mjs.map +1 -1
  44. package/dist/browser-prod/CartLineQuantityAdjustButton.mjs.map +1 -1
  45. package/dist/browser-prod/CartProvider.mjs.map +1 -1
  46. package/dist/browser-prod/ExternalVideo.mjs.map +1 -1
  47. package/dist/browser-prod/Image.mjs.map +1 -1
  48. package/dist/browser-prod/MediaFile.mjs.map +1 -1
  49. package/dist/browser-prod/ModelViewer.mjs.map +1 -1
  50. package/dist/browser-prod/Money.mjs.map +1 -1
  51. package/dist/browser-prod/ProductPrice.mjs.map +1 -1
  52. package/dist/browser-prod/ProductProvider.mjs.map +1 -1
  53. package/dist/browser-prod/RichText.mjs.map +1 -1
  54. package/dist/browser-prod/ShopPayButton.mjs.map +1 -1
  55. package/dist/browser-prod/ShopifyProvider.mjs.map +1 -1
  56. package/dist/browser-prod/Video.mjs.map +1 -1
  57. package/dist/browser-prod/analytics-constants.mjs.map +1 -1
  58. package/dist/browser-prod/analytics-utils.mjs.map +1 -1
  59. package/dist/browser-prod/analytics.mjs.map +1 -1
  60. package/dist/browser-prod/cart-queries.mjs +43 -81
  61. package/dist/browser-prod/cart-queries.mjs.map +1 -1
  62. package/dist/browser-prod/codegen.helpers.mjs.map +1 -1
  63. package/dist/browser-prod/cookies-utils.mjs.map +1 -1
  64. package/dist/browser-prod/flatten-connection.mjs.map +1 -1
  65. package/dist/browser-prod/getProductOptions.mjs.map +1 -1
  66. package/dist/browser-prod/load-script.mjs.map +1 -1
  67. package/dist/browser-prod/optionValueDecoder.mjs.map +1 -1
  68. package/dist/browser-prod/packages/hydrogen-react/package.json.mjs +1 -1
  69. package/dist/browser-prod/parse-metafield.mjs.map +1 -1
  70. package/dist/browser-prod/storefront-client.mjs.map +1 -1
  71. package/dist/browser-prod/tracking-utils.mjs.map +1 -1
  72. package/dist/browser-prod/useMoney.mjs.map +1 -1
  73. package/dist/browser-prod/useSelectedOptionInUrlParam.mjs.map +1 -1
  74. package/dist/browser-prod/useShopifyCookies.mjs.map +1 -1
  75. package/dist/node-dev/AddToCartButton.js.map +1 -1
  76. package/dist/node-dev/AddToCartButton.mjs.map +1 -1
  77. package/dist/node-dev/BuyNowButton.js.map +1 -1
  78. package/dist/node-dev/BuyNowButton.mjs.map +1 -1
  79. package/dist/node-dev/CartCheckoutButton.js.map +1 -1
  80. package/dist/node-dev/CartCheckoutButton.mjs.map +1 -1
  81. package/dist/node-dev/CartCost.js.map +1 -1
  82. package/dist/node-dev/CartCost.mjs.map +1 -1
  83. package/dist/node-dev/CartLineProvider.js.map +1 -1
  84. package/dist/node-dev/CartLineProvider.mjs.map +1 -1
  85. package/dist/node-dev/CartLineQuantity.js.map +1 -1
  86. package/dist/node-dev/CartLineQuantity.mjs.map +1 -1
  87. package/dist/node-dev/CartLineQuantityAdjustButton.js.map +1 -1
  88. package/dist/node-dev/CartLineQuantityAdjustButton.mjs.map +1 -1
  89. package/dist/node-dev/CartProvider.js.map +1 -1
  90. package/dist/node-dev/CartProvider.mjs.map +1 -1
  91. package/dist/node-dev/ExternalVideo.js.map +1 -1
  92. package/dist/node-dev/ExternalVideo.mjs.map +1 -1
  93. package/dist/node-dev/Image.js.map +1 -1
  94. package/dist/node-dev/Image.mjs.map +1 -1
  95. package/dist/node-dev/MediaFile.js.map +1 -1
  96. package/dist/node-dev/MediaFile.mjs.map +1 -1
  97. package/dist/node-dev/ModelViewer.js.map +1 -1
  98. package/dist/node-dev/ModelViewer.mjs.map +1 -1
  99. package/dist/node-dev/Money.js.map +1 -1
  100. package/dist/node-dev/Money.mjs.map +1 -1
  101. package/dist/node-dev/ProductPrice.js.map +1 -1
  102. package/dist/node-dev/ProductPrice.mjs.map +1 -1
  103. package/dist/node-dev/ProductProvider.js.map +1 -1
  104. package/dist/node-dev/ProductProvider.mjs.map +1 -1
  105. package/dist/node-dev/RichText.js.map +1 -1
  106. package/dist/node-dev/RichText.mjs.map +1 -1
  107. package/dist/node-dev/ShopPayButton.js.map +1 -1
  108. package/dist/node-dev/ShopPayButton.mjs.map +1 -1
  109. package/dist/node-dev/ShopifyProvider.js.map +1 -1
  110. package/dist/node-dev/ShopifyProvider.mjs.map +1 -1
  111. package/dist/node-dev/Video.js.map +1 -1
  112. package/dist/node-dev/Video.mjs.map +1 -1
  113. package/dist/node-dev/analytics-constants.js.map +1 -1
  114. package/dist/node-dev/analytics-constants.mjs.map +1 -1
  115. package/dist/node-dev/analytics-utils.js.map +1 -1
  116. package/dist/node-dev/analytics-utils.mjs.map +1 -1
  117. package/dist/node-dev/analytics.js.map +1 -1
  118. package/dist/node-dev/analytics.mjs.map +1 -1
  119. package/dist/node-dev/cart-queries.js +43 -81
  120. package/dist/node-dev/cart-queries.js.map +1 -1
  121. package/dist/node-dev/cart-queries.mjs +43 -81
  122. package/dist/node-dev/cart-queries.mjs.map +1 -1
  123. package/dist/node-dev/codegen.helpers.js.map +1 -1
  124. package/dist/node-dev/codegen.helpers.mjs.map +1 -1
  125. package/dist/node-dev/cookies-utils.js.map +1 -1
  126. package/dist/node-dev/cookies-utils.mjs.map +1 -1
  127. package/dist/node-dev/flatten-connection.js.map +1 -1
  128. package/dist/node-dev/flatten-connection.mjs.map +1 -1
  129. package/dist/node-dev/getProductOptions.js.map +1 -1
  130. package/dist/node-dev/getProductOptions.mjs.map +1 -1
  131. package/dist/node-dev/load-script.js.map +1 -1
  132. package/dist/node-dev/load-script.mjs.map +1 -1
  133. package/dist/node-dev/optionValueDecoder.js.map +1 -1
  134. package/dist/node-dev/optionValueDecoder.mjs.map +1 -1
  135. package/dist/node-dev/packages/hydrogen-react/package.json.js +1 -1
  136. package/dist/node-dev/packages/hydrogen-react/package.json.mjs +1 -1
  137. package/dist/node-dev/parse-metafield.js.map +1 -1
  138. package/dist/node-dev/parse-metafield.mjs.map +1 -1
  139. package/dist/node-dev/storefront-client.js.map +1 -1
  140. package/dist/node-dev/storefront-client.mjs.map +1 -1
  141. package/dist/node-dev/tracking-utils.js.map +1 -1
  142. package/dist/node-dev/tracking-utils.mjs.map +1 -1
  143. package/dist/node-dev/useMoney.js.map +1 -1
  144. package/dist/node-dev/useMoney.mjs.map +1 -1
  145. package/dist/node-dev/useSelectedOptionInUrlParam.js.map +1 -1
  146. package/dist/node-dev/useSelectedOptionInUrlParam.mjs.map +1 -1
  147. package/dist/node-dev/useShopifyCookies.js.map +1 -1
  148. package/dist/node-dev/useShopifyCookies.mjs.map +1 -1
  149. package/dist/node-prod/AddToCartButton.js.map +1 -1
  150. package/dist/node-prod/AddToCartButton.mjs.map +1 -1
  151. package/dist/node-prod/BuyNowButton.js.map +1 -1
  152. package/dist/node-prod/BuyNowButton.mjs.map +1 -1
  153. package/dist/node-prod/CartCheckoutButton.js.map +1 -1
  154. package/dist/node-prod/CartCheckoutButton.mjs.map +1 -1
  155. package/dist/node-prod/CartCost.js.map +1 -1
  156. package/dist/node-prod/CartCost.mjs.map +1 -1
  157. package/dist/node-prod/CartLineProvider.js.map +1 -1
  158. package/dist/node-prod/CartLineProvider.mjs.map +1 -1
  159. package/dist/node-prod/CartLineQuantity.js.map +1 -1
  160. package/dist/node-prod/CartLineQuantity.mjs.map +1 -1
  161. package/dist/node-prod/CartLineQuantityAdjustButton.js.map +1 -1
  162. package/dist/node-prod/CartLineQuantityAdjustButton.mjs.map +1 -1
  163. package/dist/node-prod/CartProvider.js.map +1 -1
  164. package/dist/node-prod/CartProvider.mjs.map +1 -1
  165. package/dist/node-prod/ExternalVideo.js.map +1 -1
  166. package/dist/node-prod/ExternalVideo.mjs.map +1 -1
  167. package/dist/node-prod/Image.js.map +1 -1
  168. package/dist/node-prod/Image.mjs.map +1 -1
  169. package/dist/node-prod/MediaFile.js.map +1 -1
  170. package/dist/node-prod/MediaFile.mjs.map +1 -1
  171. package/dist/node-prod/ModelViewer.js.map +1 -1
  172. package/dist/node-prod/ModelViewer.mjs.map +1 -1
  173. package/dist/node-prod/Money.js.map +1 -1
  174. package/dist/node-prod/Money.mjs.map +1 -1
  175. package/dist/node-prod/ProductPrice.js.map +1 -1
  176. package/dist/node-prod/ProductPrice.mjs.map +1 -1
  177. package/dist/node-prod/ProductProvider.js.map +1 -1
  178. package/dist/node-prod/ProductProvider.mjs.map +1 -1
  179. package/dist/node-prod/RichText.js.map +1 -1
  180. package/dist/node-prod/RichText.mjs.map +1 -1
  181. package/dist/node-prod/ShopPayButton.js.map +1 -1
  182. package/dist/node-prod/ShopPayButton.mjs.map +1 -1
  183. package/dist/node-prod/ShopifyProvider.js.map +1 -1
  184. package/dist/node-prod/ShopifyProvider.mjs.map +1 -1
  185. package/dist/node-prod/Video.js.map +1 -1
  186. package/dist/node-prod/Video.mjs.map +1 -1
  187. package/dist/node-prod/analytics-constants.js.map +1 -1
  188. package/dist/node-prod/analytics-constants.mjs.map +1 -1
  189. package/dist/node-prod/analytics-utils.js.map +1 -1
  190. package/dist/node-prod/analytics-utils.mjs.map +1 -1
  191. package/dist/node-prod/analytics.js.map +1 -1
  192. package/dist/node-prod/analytics.mjs.map +1 -1
  193. package/dist/node-prod/cart-queries.js +43 -81
  194. package/dist/node-prod/cart-queries.js.map +1 -1
  195. package/dist/node-prod/cart-queries.mjs +43 -81
  196. package/dist/node-prod/cart-queries.mjs.map +1 -1
  197. package/dist/node-prod/codegen.helpers.js.map +1 -1
  198. package/dist/node-prod/codegen.helpers.mjs.map +1 -1
  199. package/dist/node-prod/cookies-utils.js.map +1 -1
  200. package/dist/node-prod/cookies-utils.mjs.map +1 -1
  201. package/dist/node-prod/flatten-connection.js.map +1 -1
  202. package/dist/node-prod/flatten-connection.mjs.map +1 -1
  203. package/dist/node-prod/getProductOptions.js.map +1 -1
  204. package/dist/node-prod/getProductOptions.mjs.map +1 -1
  205. package/dist/node-prod/load-script.js.map +1 -1
  206. package/dist/node-prod/load-script.mjs.map +1 -1
  207. package/dist/node-prod/optionValueDecoder.js.map +1 -1
  208. package/dist/node-prod/optionValueDecoder.mjs.map +1 -1
  209. package/dist/node-prod/packages/hydrogen-react/package.json.js +1 -1
  210. package/dist/node-prod/packages/hydrogen-react/package.json.mjs +1 -1
  211. package/dist/node-prod/parse-metafield.js.map +1 -1
  212. package/dist/node-prod/parse-metafield.mjs.map +1 -1
  213. package/dist/node-prod/storefront-client.js.map +1 -1
  214. package/dist/node-prod/storefront-client.mjs.map +1 -1
  215. package/dist/node-prod/tracking-utils.js.map +1 -1
  216. package/dist/node-prod/tracking-utils.mjs.map +1 -1
  217. package/dist/node-prod/useMoney.js.map +1 -1
  218. package/dist/node-prod/useMoney.mjs.map +1 -1
  219. package/dist/node-prod/useSelectedOptionInUrlParam.js.map +1 -1
  220. package/dist/node-prod/useSelectedOptionInUrlParam.mjs.map +1 -1
  221. package/dist/node-prod/useShopifyCookies.js.map +1 -1
  222. package/dist/node-prod/useShopifyCookies.mjs.map +1 -1
  223. package/dist/types/AddToCartButton.d.ts +2 -0
  224. package/dist/types/BuyNowButton.d.ts +2 -0
  225. package/dist/types/CartCheckoutButton.d.ts +2 -0
  226. package/dist/types/CartCost.d.ts +2 -0
  227. package/dist/types/CartLineProvider.d.ts +2 -0
  228. package/dist/types/CartLineQuantity.d.ts +2 -0
  229. package/dist/types/CartLineQuantityAdjustButton.d.ts +1 -0
  230. package/dist/types/CartProvider.d.ts +7 -1
  231. package/dist/types/ExternalVideo.d.ts +4 -0
  232. package/dist/types/Image.d.ts +2 -0
  233. package/dist/types/MediaFile.d.ts +4 -0
  234. package/dist/types/ModelViewer.d.ts +1 -0
  235. package/dist/types/Money.d.ts +1 -0
  236. package/dist/types/ProductPrice.d.ts +2 -0
  237. package/dist/types/ProductProvider.d.ts +2 -0
  238. package/dist/types/RichText.d.ts +2 -0
  239. package/dist/types/ShopPayButton.d.ts +1 -0
  240. package/dist/types/ShopifyProvider.d.ts +2 -0
  241. package/dist/types/Video.d.ts +2 -0
  242. package/dist/types/analytics-constants.d.ts +9 -0
  243. package/dist/types/analytics-types.d.ts +1 -0
  244. package/dist/types/analytics-utils.d.ts +1 -0
  245. package/dist/types/analytics.d.ts +6 -1
  246. package/dist/types/cart-queries.d.ts +13 -9
  247. package/dist/types/codegen.helpers.d.ts +2 -0
  248. package/dist/types/cookies-utils.d.ts +2 -1
  249. package/dist/types/flatten-connection.d.ts +3 -0
  250. package/dist/types/getProductOptions.d.ts +3 -0
  251. package/dist/types/load-script.d.ts +3 -1
  252. package/dist/types/optionValueDecoder.d.ts +3 -0
  253. package/dist/types/parse-metafield.d.ts +1 -0
  254. package/dist/types/storefront-client.d.ts +1 -0
  255. package/dist/types/tracking-utils.d.ts +2 -2
  256. package/dist/types/useMoney.d.ts +1 -0
  257. package/dist/types/useSelectedOptionInUrlParam.d.ts +1 -0
  258. package/dist/types/useShopifyCookies.d.ts +1 -0
  259. package/dist/umd/hydrogen-react.dev.js +44 -82
  260. package/dist/umd/hydrogen-react.dev.js.map +1 -1
  261. package/dist/umd/hydrogen-react.prod.js +43 -88
  262. package/dist/umd/hydrogen-react.prod.js.map +1 -1
  263. package/package.json +2 -2
@@ -2,6 +2,7 @@ import { type HTMLAttributes } from 'react';
2
2
  import { shopifyLoader } from './Image.js';
3
3
  import type { Video as VideoType } from './storefront-api-types.js';
4
4
  import type { PartialDeep } from 'type-fest';
5
+ /** @publicDocs */
5
6
  export interface VideoProps {
6
7
  /** An object with fields that correspond to the Storefront API's [Video object](https://shopify.dev/api/storefront/2026-04/objects/video). */
7
8
  data: PartialDeep<VideoType, {
@@ -16,5 +17,6 @@ export interface VideoProps {
16
17
  }
17
18
  /**
18
19
  * The `Video` component renders a `video` for the Storefront API's [Video object](https://shopify.dev/api/storefront/reference/products/video).
20
+ * @publicDocs
19
21
  */
20
22
  export declare const Video: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLVideoElement> & import("react").VideoHTMLAttributes<HTMLVideoElement> & VideoProps, "ref"> & import("react").RefAttributes<HTMLVideoElement>>;
@@ -16,12 +16,18 @@ export declare const ShopifyAppId: {
16
16
  * These duplicated interface declaration is so that we can generate proper documentation
17
17
  * for these public facing constants
18
18
  */
19
+ /**
20
+ * Analytics event names accepted by Shopify analytics.
21
+ * @publicDocs */
19
22
  export interface AnalyticsEventName {
20
23
  /** Page view */
21
24
  PAGE_VIEW: 'PAGE_VIEW';
22
25
  /** Add to cart */
23
26
  ADD_TO_CART: 'ADD_TO_CART';
24
27
  }
28
+ /**
29
+ * Analytics page type values accepted by Shopify analytics.
30
+ * @publicDocs */
25
31
  export interface AnalyticsPageType {
26
32
  article: 'article';
27
33
  blog: 'blog';
@@ -46,6 +52,9 @@ export interface AnalyticsPageType {
46
52
  policy: 'policy';
47
53
  search: 'search';
48
54
  }
55
+ /**
56
+ * Analytics sales channel values accepted by Shopify analytics.
57
+ * @publicDocs */
49
58
  export interface ShopifySalesChannel {
50
59
  /** Shopify Hydrogen sales channel */
51
60
  hydrogen: 'hydrogen';
@@ -180,6 +180,7 @@ export type ShopifyAnalyticsPayload = ShopifyPageViewPayload | ShopifyAddToCartP
180
180
  */
181
181
  export type ShopifyAnalyticsPayloadWithPrivacyFields = ShopifyPageViewPayloadWithPrivacyFields | ShopifyAddToCartPayloadWithPrivacyFields;
182
182
  export type ShopifyAnalytics = ShopifyPageView | ShopifyAddToCart;
183
+ /** Shopify cookies names */
183
184
  export type ShopifyCookies = {
184
185
  /** Shopify unique user token: Value of `_shopify_y` cookie. */
185
186
  [SHOPIFY_Y]: string;
@@ -19,6 +19,7 @@ export declare function schemaWrapper(schemaId: string, payload: ShopifyMonorail
19
19
  * * const {id, resource} = parseGid('gid://shopify/Cart/abc123')
20
20
  * // => id = "abc123", resource = 'Cart'
21
21
  * ```
22
+ * @publicDocs
22
23
  **/
23
24
  export declare function parseGid(gid: string | undefined): ShopifyGid;
24
25
  /**
@@ -1,9 +1,14 @@
1
1
  import type { ClientBrowserParameters, ShopifyAnalytics } from './analytics-types.js';
2
2
  /**
3
- * Set user and session cookies and refresh the expiry time
3
+ * Set user and session cookies and refresh the expiry time. If `event.payload.hasUserConsent` is false, no analytics event will happen.
4
4
  * @param event - The analytics event.
5
5
  * @param shopDomain - The Online Store domain to sent Shopify analytics under the same
6
6
  * top level domain.
7
+ * @publicDocs
7
8
  */
8
9
  export declare function sendShopifyAnalytics(event: ShopifyAnalytics, shopDomain?: string): Promise<void>;
10
+ /**
11
+ * If executed on server, this method will return empty string for each field.
12
+ * @publicDocs
13
+ */
9
14
  export declare function getClientBrowserParameters(): ClientBrowserParameters;
@@ -1,10 +1,14 @@
1
- export declare const CartLineAdd: (cartFragment: string) => string;
2
- export declare const CartCreate: (cartFragment: string) => string;
3
- export declare const CartLineRemove: (cartFragment: string) => string;
4
- export declare const CartLineUpdate: (cartFragment: string) => string;
5
- export declare const CartNoteUpdate: (cartFragment: string) => string;
6
- export declare const CartBuyerIdentityUpdate: (cartFragment: string) => string;
7
- export declare const CartAttributesUpdate: (cartFragment: string) => string;
8
- export declare const CartDiscountCodesUpdate: (cartFragment: string) => string;
9
- export declare const CartQuery: (cartFragment: string) => string;
1
+ type CartQueryOptions = {
2
+ includeVisitorConsent?: boolean;
3
+ };
4
+ export declare const CartLineAdd: (cartFragment: string, options?: CartQueryOptions) => string;
5
+ export declare const CartCreate: (cartFragment: string, options?: CartQueryOptions) => string;
6
+ export declare const CartLineRemove: (cartFragment: string, options?: CartQueryOptions) => string;
7
+ export declare const CartLineUpdate: (cartFragment: string, options?: CartQueryOptions) => string;
8
+ export declare const CartNoteUpdate: (cartFragment: string, options?: CartQueryOptions) => string;
9
+ export declare const CartBuyerIdentityUpdate: (cartFragment: string, options?: CartQueryOptions) => string;
10
+ export declare const CartAttributesUpdate: (cartFragment: string, options?: CartQueryOptions) => string;
11
+ export declare const CartDiscountCodesUpdate: (cartFragment: string, options?: CartQueryOptions) => string;
12
+ export declare const CartQuery: (cartFragment: string, options?: CartQueryOptions) => string;
10
13
  export declare const defaultCartFragment = "\n fragment CartFragment on Cart {\n id\n checkoutUrl\n totalQuantity\n buyerIdentity {\n countryCode\n customer {\n id\n email\n firstName\n lastName\n displayName\n }\n email\n phone\n }\n lines(first: $numCartLines) {\n edges {\n node {\n id\n quantity\n attributes {\n key\n value\n }\n cost {\n totalAmount {\n amount\n currencyCode\n }\n compareAtAmountPerQuantity {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n availableForSale\n compareAtPrice {\n ...MoneyFragment\n }\n price {\n ...MoneyFragment\n }\n requiresShipping\n title\n image {\n ...ImageFragment\n }\n product {\n handle\n title\n id\n }\n selectedOptions {\n name\n value\n }\n }\n }\n }\n }\n }\n cost {\n subtotalAmount {\n ...MoneyFragment\n }\n totalAmount {\n ...MoneyFragment\n }\n totalDutyAmount {\n ...MoneyFragment\n }\n totalTaxAmount {\n ...MoneyFragment\n }\n }\n note\n attributes {\n key\n value\n }\n discountCodes {\n code\n applicable\n }\n }\n\n fragment MoneyFragment on MoneyV2 {\n currencyCode\n amount\n }\n fragment ImageFragment on Image {\n id\n url\n altText\n width\n height\n }\n";
14
+ export {};
@@ -2,6 +2,7 @@
2
2
  * Meant to be used with GraphQL CodeGen to type the Storefront API's custom scalars correctly.
3
3
  * Reference for the GraphQL types: https://shopify.dev/docs/api/storefront/2026-04/scalars/HTML
4
4
  * Note: JSON is generated as 'unknown' by default.
5
+ * @publicDocs
5
6
  */
6
7
  export declare const storefrontApiCustomScalars: {
7
8
  DateTime: string;
@@ -15,6 +16,7 @@ export declare const storefrontApiCustomScalars: {
15
16
  * Meant to be used with GraphQL CodeGen to type the Storefront API's custom scalars correctly.
16
17
  * Reference for the GraphQL types: https://shopify.dev/docs/api/customer/2026-04/scalars/HTML
17
18
  * Note: JSON is generated as 'unknown' by default.
19
+ * @publicDocs
18
20
  */
19
21
  export declare const customerAccountApiCustomScalars: {
20
22
  DateTime: string;
@@ -2,7 +2,8 @@ import { ShopifyCookies } from './analytics-types.js';
2
2
  export declare function buildUUID(): string;
3
3
  export declare function hexTime(): string;
4
4
  /**
5
- * Gets the values of _shopify_y and _shopify_s cookies from the provided cookie string.
5
+ * Gets the values of _shopify_y and _shopify_s cookies from the provided cookie string. If the Shopify cookies doesn't exist, this method will return an empty string for each missing cookie.
6
6
  * @deprecated Use getTrackingValues instead.
7
+ * @publicDocs
7
8
  */
8
9
  export declare function getShopifyCookies(cookies: string): ShopifyCookies;
@@ -4,6 +4,7 @@ import type { PartialDeep } from 'type-fest';
4
4
  * The utility works with either `nodes` or `edges.node`.
5
5
  *
6
6
  * If `connection` is null or undefined, will return an empty array instead in production. In development, an error will be thrown.
7
+ * @publicDocs
7
8
  */
8
9
  export declare function flattenConnection<ConnectionGeneric extends PartialDeep<ConnectionEdges, {
9
10
  recurseIntoArrays: true;
@@ -36,8 +37,10 @@ type ConnectionEdges = {
36
37
  type ConnectionNodes = {
37
38
  nodes: Array<unknown>;
38
39
  };
40
+ /** @publicDocs */
39
41
  export interface ConnectionGenericForDoc {
40
42
  connection?: ConnectionEdges | ConnectionNodes;
41
43
  }
44
+ /** @publicDocs */
42
45
  export type FlattenConnectionReturnForDoc = unknown[];
43
46
  export {};
@@ -30,6 +30,7 @@ type MappedProductOptionValue = ProductOptionValue & ProductOptionValueState;
30
30
  * Color: 'Red',
31
31
  * Size: 'Medium',
32
32
  * \}
33
+ * @publicDocs
33
34
  */
34
35
  export declare function mapSelectedProductOptionToObject(options: Pick<SelectedOption, 'name' | 'value'>[]): Record<string, string>;
35
36
  export type MappedProductOptions = Omit<ProductOption, 'optionValues'> & {
@@ -39,11 +40,13 @@ export declare function checkProductParam(product: RecursivePartial<Product>, ch
39
40
  /**
40
41
  * Finds all the variants provided by adjacentVariants, options.optionValues.firstAvailableVariant,
41
42
  * and selectedOrFirstAvailableVariant and return them in a single array
43
+ * @publicDocs
42
44
  */
43
45
  export declare function getAdjacentAndFirstAvailableVariants(product: RecursivePartial<Product>): ProductVariant[];
44
46
  /**
45
47
  * Returns a product options array with its relevant information
46
48
  * about the variant
49
+ * @publicDocs
47
50
  */
48
51
  export declare function getProductOptions(product: RecursivePartial<Product>): MappedProductOptions[];
49
52
  export {};
@@ -4,9 +4,11 @@ type LoadScriptOptions = {
4
4
  attributes?: Record<string, string>;
5
5
  };
6
6
  export declare function loadScript(src: string, options?: LoadScriptOptions): Promise<boolean>;
7
- type LoadScriptParams = Parameters<typeof loadScript>;
7
+ /** @publicDocs */
8
+ export type LoadScriptParams = Parameters<typeof loadScript>;
8
9
  /**
9
10
  * The `useLoadScript` hook loads an external script tag in the browser. It allows React components to lazy-load large third-party dependencies.
11
+ * @publicDocs
10
12
  */
11
13
  export declare function useLoadScript(url: LoadScriptParams[0], options?: LoadScriptParams[1]): ScriptState;
12
14
  type ScriptState = 'loading' | 'done' | 'error';
@@ -9,6 +9,7 @@
9
9
  * - `-` indicates a continuous range of option values. ex: `0 1-3 4`. Ranges are only present encoded in the final option value position, so for example the trie for the set [[0,0,0],[0,0,1], ..., [0,2,2]] will be structured as `0:0:0-2,1:0-2,2:0-2`, not `0:0-2:0-2`.
10
10
  */
11
11
  import { Product } from './storefront-api-types.js';
12
+ /** @publicDocs */
12
13
  export type IsOptionValueCombinationInEncodedVariant = (targetOptionValueCombination: number[], encodedVariantField: string) => boolean;
13
14
  /**
14
15
  * Determine whether an option value combination is present in an encoded option value string. Function is memoized by encodedVariantField.
@@ -16,6 +17,7 @@ export type IsOptionValueCombinationInEncodedVariant = (targetOptionValueCombina
16
17
  * @param targetOptionValueCombination - Indices of option values to look up in the encoded option value string. A partial set of indices may be passed to determine whether a node or any children is present. For example, if a product has 3 options, passing [0] will return true if any option value combination for the first option's option value is present in the encoded string.
17
18
  * @param encodedVariantField - Encoded option value string from the Storefront API, e.g. [product.encodedVariantExistence](/docs/api/storefront/2026-04/objects/Product#field-encodedvariantexistence) or [product.encodedVariantAvailability](/docs/api/storefront/2026-04/objects/Product#field-encodedvariantavailability)
18
19
  * @returns - True if a full or partial targetOptionValueIndices is present in the encoded option value string, false otherwise.
20
+ * @publicDocs
19
21
  */
20
22
  export declare const isOptionValueCombinationInEncodedVariant: IsOptionValueCombinationInEncodedVariant;
21
23
  type EncodedVariantField = Product['encodedVariantAvailability'] | Product['encodedVariantExistence'];
@@ -24,6 +26,7 @@ type DecodedOptionValues = number[][];
24
26
  * For an encoded option value string, decode into option value combinations. Entries represent a valid combination formatted as an array of option value positions.
25
27
  * @param encodedVariantField - Encoded option value string from the Storefront API, e.g. [product.encodedVariantExistence](/docs/api/storefront/2026-04/objects/Product#field-encodedvariantexistence) or [product.encodedVariantAvailability](/docs/api/storefront/2026-04/objects/Product#field-encodedvariantavailability)
26
28
  * @returns Decoded option value combinations
29
+ * @publicDocs
27
30
  */
28
31
  export declare function decodeEncodedVariant(encodedVariantField: EncodedVariantField): DecodedOptionValues;
29
32
  export {};
@@ -9,6 +9,7 @@ import { RootASTNode as RichTextRootASTNode } from './RichText.types.js';
9
9
  * ```
10
10
  * parseMetafield<ParsedMetafields['boolean']>({type: 'boolean', value: 'false'}
11
11
  * ```
12
+ * @publicDocs
12
13
  */
13
14
  export declare function parseMetafield<ReturnGeneric>(metafield: PartialDeep<MetafieldBaseType, {
14
15
  recurseIntoArrays: true;
@@ -18,6 +18,7 @@ export type StorefrontClientProps = {
18
18
  * The `createStorefrontClient()` function creates helpers that enable you to quickly query the Shopify Storefront API.
19
19
  *
20
20
  * When used on the server, it is recommended to use the `privateStorefrontToken` prop. When used on the client, it is recommended to use the `publicStorefrontToken` prop.
21
+ * @publicDocs
21
22
  */
22
23
  export declare function createStorefrontClient({ storeDomain, privateStorefrontToken, publicStorefrontToken, storefrontApiVersion, contentType, }: StorefrontClientProps): StorefrontClientReturn;
23
24
  export declare function getPublicTokenHeadersRaw(contentType: 'graphql' | 'json', storefrontApiVersion: string, accessToken: string): {
@@ -14,8 +14,8 @@ export declare const cachedTrackingValues: {
14
14
  current: null | TrackingValues;
15
15
  };
16
16
  /**
17
- * Retrieves user session tracking values for analytics
18
- * and marketing from the browser environment.
17
+ * Retrieves user session tracking values for analytics and marketing from the browser environment.
18
+ * @publicDocs
19
19
  */
20
20
  export declare function getTrackingValues(): TrackingValues;
21
21
  export {};
@@ -109,6 +109,7 @@ export type UseMoneyValue = {
109
109
  * ```ts
110
110
  * money.withoutTrailingZerosAndCurrency
111
111
  * ```
112
+ * @publicDocs
112
113
  */
113
114
  export declare function useMoney(money: MoneyV2): UseMoneyValue;
114
115
  export {};
@@ -1,2 +1,3 @@
1
1
  import { SelectedOption } from './storefront-api-types.js';
2
+ /** @publicDocs */
2
3
  export declare function useSelectedOptionInUrlParam(selectedOptions: Pick<SelectedOption, 'name' | 'value'>[]): null;
@@ -34,6 +34,7 @@ type UseShopifyCookiesOptions = CoreShopifyCookiesOptions & {
34
34
  * Useful when you only want to use the newer tracking values and not rely on the deprecated ones.
35
35
  *
36
36
  * @returns `true` when cookies are set and ready.
37
+ * @publicDocs
37
38
  */
38
39
  export declare function useShopifyCookies(options?: UseShopifyCookiesOptions): boolean;
39
40
  type CoreShopifyCookiesOptions = {
@@ -252,22 +252,32 @@
252
252
  }
253
253
  return [];
254
254
  }
255
- const CartLineAdd = (cartFragment) => (
255
+ function getInContextVariables(includeVisitorConsent) {
256
+ const base = `$country: CountryCode = ZZ
257
+ $language: LanguageCode`;
258
+ return includeVisitorConsent ? `${base}
259
+ $visitorConsent: VisitorConsent` : base;
260
+ }
261
+ function getInContextDirective(includeVisitorConsent) {
262
+ return includeVisitorConsent ? `@inContext(
263
+ country: $country
264
+ language: $language
265
+ visitorConsent: $visitorConsent
266
+ )` : `@inContext(
267
+ country: $country
268
+ language: $language
269
+ )`;
270
+ }
271
+ const CartLineAdd = (cartFragment, options = {}) => (
256
272
  /* GraphQL */
257
273
  `
258
274
  mutation CartLineAdd(
259
275
  $cartId: ID!
260
276
  $lines: [CartLineInput!]!
261
277
  $numCartLines: Int = 250
262
- $country: CountryCode = ZZ
263
- $language: LanguageCode
264
- $visitorConsent: VisitorConsent
278
+ ${getInContextVariables(options.includeVisitorConsent ?? false)}
265
279
  )
266
- @inContext(
267
- country: $country
268
- language: $language
269
- visitorConsent: $visitorConsent
270
- ) {
280
+ ${getInContextDirective(options.includeVisitorConsent ?? false)} {
271
281
  cartLinesAdd(cartId: $cartId, lines: $lines) {
272
282
  cart {
273
283
  ...CartFragment
@@ -278,21 +288,15 @@
278
288
  ${cartFragment}
279
289
  `
280
290
  );
281
- const CartCreate = (cartFragment) => (
291
+ const CartCreate = (cartFragment, options = {}) => (
282
292
  /* GraphQL */
283
293
  `
284
294
  mutation CartCreate(
285
295
  $input: CartInput!
286
296
  $numCartLines: Int = 250
287
- $country: CountryCode = ZZ
288
- $language: LanguageCode
289
- $visitorConsent: VisitorConsent
297
+ ${getInContextVariables(options.includeVisitorConsent ?? false)}
290
298
  )
291
- @inContext(
292
- country: $country
293
- language: $language
294
- visitorConsent: $visitorConsent
295
- ) {
299
+ ${getInContextDirective(options.includeVisitorConsent ?? false)} {
296
300
  cartCreate(input: $input) {
297
301
  cart {
298
302
  ...CartFragment
@@ -303,22 +307,16 @@
303
307
  ${cartFragment}
304
308
  `
305
309
  );
306
- const CartLineRemove = (cartFragment) => (
310
+ const CartLineRemove = (cartFragment, options = {}) => (
307
311
  /* GraphQL */
308
312
  `
309
313
  mutation CartLineRemove(
310
314
  $cartId: ID!
311
315
  $lines: [ID!]!
312
316
  $numCartLines: Int = 250
313
- $country: CountryCode = ZZ
314
- $language: LanguageCode
315
- $visitorConsent: VisitorConsent
317
+ ${getInContextVariables(options.includeVisitorConsent ?? false)}
316
318
  )
317
- @inContext(
318
- country: $country
319
- language: $language
320
- visitorConsent: $visitorConsent
321
- ) {
319
+ ${getInContextDirective(options.includeVisitorConsent ?? false)} {
322
320
  cartLinesRemove(cartId: $cartId, lineIds: $lines) {
323
321
  cart {
324
322
  ...CartFragment
@@ -329,22 +327,16 @@
329
327
  ${cartFragment}
330
328
  `
331
329
  );
332
- const CartLineUpdate = (cartFragment) => (
330
+ const CartLineUpdate = (cartFragment, options = {}) => (
333
331
  /* GraphQL */
334
332
  `
335
333
  mutation CartLineUpdate(
336
334
  $cartId: ID!
337
335
  $lines: [CartLineUpdateInput!]!
338
336
  $numCartLines: Int = 250
339
- $country: CountryCode = ZZ
340
- $language: LanguageCode
341
- $visitorConsent: VisitorConsent
337
+ ${getInContextVariables(options.includeVisitorConsent ?? false)}
342
338
  )
343
- @inContext(
344
- country: $country
345
- language: $language
346
- visitorConsent: $visitorConsent
347
- ) {
339
+ ${getInContextDirective(options.includeVisitorConsent ?? false)} {
348
340
  cartLinesUpdate(cartId: $cartId, lines: $lines) {
349
341
  cart {
350
342
  ...CartFragment
@@ -355,22 +347,16 @@
355
347
  ${cartFragment}
356
348
  `
357
349
  );
358
- const CartNoteUpdate = (cartFragment) => (
350
+ const CartNoteUpdate = (cartFragment, options = {}) => (
359
351
  /* GraphQL */
360
352
  `
361
353
  mutation CartNoteUpdate(
362
354
  $cartId: ID!
363
355
  $note: String!
364
356
  $numCartLines: Int = 250
365
- $country: CountryCode = ZZ
366
- $language: LanguageCode
367
- $visitorConsent: VisitorConsent
357
+ ${getInContextVariables(options.includeVisitorConsent ?? false)}
368
358
  )
369
- @inContext(
370
- country: $country
371
- language: $language
372
- visitorConsent: $visitorConsent
373
- ) {
359
+ ${getInContextDirective(options.includeVisitorConsent ?? false)} {
374
360
  cartNoteUpdate(cartId: $cartId, note: $note) {
375
361
  cart {
376
362
  ...CartFragment
@@ -381,22 +367,16 @@
381
367
  ${cartFragment}
382
368
  `
383
369
  );
384
- const CartBuyerIdentityUpdate = (cartFragment) => (
370
+ const CartBuyerIdentityUpdate = (cartFragment, options = {}) => (
385
371
  /* GraphQL */
386
372
  `
387
373
  mutation CartBuyerIdentityUpdate(
388
374
  $cartId: ID!
389
375
  $buyerIdentity: CartBuyerIdentityInput!
390
376
  $numCartLines: Int = 250
391
- $country: CountryCode = ZZ
392
- $language: LanguageCode
393
- $visitorConsent: VisitorConsent
377
+ ${getInContextVariables(options.includeVisitorConsent ?? false)}
394
378
  )
395
- @inContext(
396
- country: $country
397
- language: $language
398
- visitorConsent: $visitorConsent
399
- ) {
379
+ ${getInContextDirective(options.includeVisitorConsent ?? false)} {
400
380
  cartBuyerIdentityUpdate(cartId: $cartId, buyerIdentity: $buyerIdentity) {
401
381
  cart {
402
382
  ...CartFragment
@@ -407,22 +387,16 @@
407
387
  ${cartFragment}
408
388
  `
409
389
  );
410
- const CartAttributesUpdate = (cartFragment) => (
390
+ const CartAttributesUpdate = (cartFragment, options = {}) => (
411
391
  /* GraphQL */
412
392
  `
413
393
  mutation CartAttributesUpdate(
414
394
  $attributes: [AttributeInput!]!
415
395
  $cartId: ID!
416
396
  $numCartLines: Int = 250
417
- $country: CountryCode = ZZ
418
- $language: LanguageCode
419
- $visitorConsent: VisitorConsent
397
+ ${getInContextVariables(options.includeVisitorConsent ?? false)}
420
398
  )
421
- @inContext(
422
- country: $country
423
- language: $language
424
- visitorConsent: $visitorConsent
425
- ) {
399
+ ${getInContextDirective(options.includeVisitorConsent ?? false)} {
426
400
  cartAttributesUpdate(attributes: $attributes, cartId: $cartId) {
427
401
  cart {
428
402
  ...CartFragment
@@ -433,22 +407,16 @@
433
407
  ${cartFragment}
434
408
  `
435
409
  );
436
- const CartDiscountCodesUpdate = (cartFragment) => (
410
+ const CartDiscountCodesUpdate = (cartFragment, options = {}) => (
437
411
  /* GraphQL */
438
412
  `
439
413
  mutation CartDiscountCodesUpdate(
440
414
  $cartId: ID!
441
415
  $discountCodes: [String!]!
442
416
  $numCartLines: Int = 250
443
- $country: CountryCode = ZZ
444
- $language: LanguageCode
445
- $visitorConsent: VisitorConsent
417
+ ${getInContextVariables(options.includeVisitorConsent ?? false)}
446
418
  )
447
- @inContext(
448
- country: $country
449
- language: $language
450
- visitorConsent: $visitorConsent
451
- ) {
419
+ ${getInContextDirective(options.includeVisitorConsent ?? false)} {
452
420
  cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {
453
421
  cart {
454
422
  ...CartFragment
@@ -459,21 +427,15 @@
459
427
  ${cartFragment}
460
428
  `
461
429
  );
462
- const CartQuery = (cartFragment) => (
430
+ const CartQuery = (cartFragment, options = {}) => (
463
431
  /* GraphQL */
464
432
  `
465
433
  query CartQuery(
466
434
  $id: ID!
467
435
  $numCartLines: Int = 250
468
- $country: CountryCode = ZZ
469
- $language: LanguageCode
470
- $visitorConsent: VisitorConsent
436
+ ${getInContextVariables(options.includeVisitorConsent ?? false)}
471
437
  )
472
- @inContext(
473
- country: $country
474
- language: $language
475
- visitorConsent: $visitorConsent
476
- ) {
438
+ ${getInContextDirective(options.includeVisitorConsent ?? false)} {
477
439
  cart(id: $id) {
478
440
  ...CartFragment
479
441
  }
@@ -2283,7 +2245,7 @@ Refer to the authentication https://shopify.dev/api/storefront#authentication do
2283
2245
  }
2284
2246
  return false;
2285
2247
  }
2286
- const version = "2026.4.0";
2248
+ const version = "2026.4.1";
2287
2249
  const SCHEMA_ID = "custom_storefront_customer_tracking/1.2";
2288
2250
  const PAGE_RENDERED_EVENT_NAME = "page_rendered";
2289
2251
  const COLLECTION_PAGE_RENDERED_EVENT_NAME = "collection_page_rendered";