--- title: "Integrating on Hydrogen (Remix)" slug: "onboarding-integrating-on-hydrogen-remix" description: "Learn to set up subscription plans in your Shopify store with our step-by-step guide, including code snippets and integration tips for a seamless experience." updated: 2025-11-12T10:25:22Z published: 2025-11-20T21:38:27Z canonical: "help.skio.com/onboarding-integrating-on-hydrogen-remix" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.skio.com/llms.txt > Use this file to discover all available pages before exploring further. # Integrating on Hydrogen (Remix) ## Setup **Repository [**[Hydrogen Playground](https://github.com/skio-org/hydrogen-remix-playground)**]** Linked is the example repository that follows the instructions from this article. This example repository is built from the latest version of [Shopify's Hydrogen Skeleton Template](https://github.com/Shopify/hydrogen/tree/main/templates/skeleton) v2024.7.10 (as of 10/16/24). ## Step 1 - Update Product and Variant queries We should retrieve the necessary selling plan information from the product and variant queries. In [**/app/routes/products.$handle.jsx**](https://github.com/skio-org/hydrogen-remix-playground/blob/main/app/routes/products.%24handle.jsx), update **PRODUCT_FRAGMENT** and **PRODUCT_VARIANT_FRAGMENT** to include the following fields: **PRODUCT_FRAGMENT** ```plaintext p... requiresSellingPlan sellingPlanGroups(first: 3) { nodes { appName name sellingPlans(first: 30) { nodes { id name description recurringDeliveries options { name value } } } } ``` **PRODUCT_VARIANT_FRAGMENT** ```plaintext ... sellingPlanAllocations(first: 30) { nodes { sellingPlan { id name priceAdjustments { orderCount adjustmentValue { ... on SellingPlanFixedAmountPriceAdjustment { adjustmentAmount { amount currencyCode } } ... on SellingPlanPercentagePriceAdjustment { adjustmentPercentage } ... on SellingPlanFixedPriceAdjustment { price { amount currencyCode } } } } options { name value } } checkoutChargeAmount { amount currencyCode } priceAdjustments { price { amount currencyCode } compareAtPrice { amount currencyCode } perDeliveryPrice { amount currencyCode } unitPrice { amount currencyCode } } } ``` ## Step 2 - Add the plan picker code In **/app/components** folder create a JSX file - **PlanPicker.jsx** with the following code from the repository: [https://github.com/skio-org/hydrogen-remix-playground/blob/main/app/components/PlanPicker.jsx](https://github.com/skio-org/hydrogen-remix-playground/blob/main/app/components/PlanPicker.jsx) ## Step 3 - Integrate the plan picker in the product form In [**/app/components/ProductForm.jsx**](https://github.com/skio-org/hydrogen-remix-playground/blob/main/app/components/ProductForm.jsx) do the following: Add state management to handle the selected subscription plan as shown below: ```plaintext const [selectedSellingPlan, setSelectedSellingPlan] = useState(null); ``` Render the plan picker within the product form: ```plaintext <> selectedVariant={selectedVariant} selectedSellingPlan={selectedSellingPlan} onPlanChange={(sp) => setSelectedSellingPlan(sp)} /> ``` Include the selected selling plan ID in the payload of the form: ```plaintext <> disabled={!selectedVariant || !selectedVariant.availableForSale} onClick={() => { open('cart'); }} lines={ selectedVariant ? [ { merchandiseId: selectedVariant.id, quantity: 1, ...(selectedSellingPlan && { sellingPlanId: selectedSellingPlan.id, }), selectedVariant, }, ] : [] } > {selectedVariant?.availableForSale ? 'Add to cart' : 'Sold out'} ``` ## Step 4 - Update Cart query to include subscription info In the [**/app/libs/fragments.js**](https://github.com/skio-org/hydrogen-remix-playground/blob/main/app/lib/fragments.js) file, update all the CartLine fragments to include the following fields: ```plaintext sellingPlanAllocation { sellingPlan { id name options { name value } } } ``` ## Step 5 - Add selling plan label to Cart's Line Item component In the [**/app/components/CartLineItem.jsx**](https://github.com/skio-org/hydrogen-remix-playground/blob/main/app/components/CartLineItem.jsx), include the sellingPlanAllocation field in the component's context: ```plaintext const {id, sellingPlanAllocation, merchandise} = line; ``` Then, in the component's view, render the selling plan label as follows: ```plaintext