Virtual Try-On for Headless Shopify and Hydrogen Stores

By Raheel Gul5 min read
Editorial illustration for Virtual Try-On for Headless Shopify and Hydrogen Stores

Quick answer

Yes, through an API instead of an app. Shopify apps that add storefront features through theme app blocks generally need a theme, and a headless or Hydrogen storefront does not have one. The Corlen API fits: your storefront sends the shopper photo and garment image to a server route, and that route calls Corlen with your key.

Going headless gives you full control of the storefront. It also hands you the job of rebuilding every feature an app used to install in one click. Try-on is one of those features.

Can you add virtual try-on to a headless Shopify store?

You can, and the build is smaller than it sounds. A try-on button needs a photo upload, one server call and a place to show the result. All three are ordinary parts of a React storefront.

What you give up is the shortcut. On a standard theme you would add our Shopify app block in the theme editor and be done by lunch. On Hydrogen there is no theme editor to add it to.

Why do most Shopify apps miss headless stores?

Many apps put their storefront features into theme app extensions, which plug into Online Store 2.0 themes. Merchant community threads and agency guides keep reporting the same result: on Hydrogen, some of those apps do not appear and others need to be wired back in through the API. Shopify's own docs are the final word, so check them for the app you are eyeing.

The Corlen Shopify app is a theme app block, so we tell headless merchants plainly to use the API instead. We would rather you hear that before you buy than discover it while staring at an empty storefront.

Editorial illustration for Virtual Try-On for Headless Shopify and Hydrogen Stores
An editorial illustration for this article

How does try-on work on Hydrogen?

The flow is the same on any custom storefront. Your catalog stays in Shopify, and only the try-on call lives in your code:

  1. Read the product's garment image through the Storefront API, as you already do for the gallery.
  2. Add a button and a photo upload to the product route.
  3. Post the photo and the garment image to a server route in your app.
  4. Have that route call the Corlen API with your key and start a job.
  5. Poll the job from the page, then show the finished image.

The request fields and job states are in the API docs, and the developer guide walks through the full flow. If you have already read our BigCommerce guide, the shape will look familiar: platforms differ, the server call does not.

Picture a store that moved to Hydrogen for speed and a custom product page. A try-on button should feel like part of that page, not a widget bolted on. With the API you own the button, the upload step and the loading state, so it can match the rest of the design.

You also own the error handling. A shopper who uploads a blurry photo or loses signal should see a clear message and a retry, not a spinner that never ends. Budget a little time for that part, because it decides how the feature feels.

What goes wrong on a custom storefront?

  • The key in the browser: keep it in a server only variable. A key in client code is public, whatever you named the file.
  • Large phone photos: resize before upload, or the request is slow and some hosts reject it.
  • Edge runtime limits: a long generation can outlast a short request limit, so start a job and poll rather than waiting on one request.
  • Logging uploads: your own server should not store or log shopper photos. Corlen on the API does not save them, and your route should match.

Is it worth the build?

If you already have developers on the storefront, it is a small feature on a project they own. If you have no developer, headless was probably a heavier choice than the store needed, and a standard theme with the app block would be cheaper to run.

Before any code, run your hardest garments through the live demo. Good product photos matter more than the framework, so see how to photograph clothing for virtual try-on. Once it ships, track it with how to measure virtual try-on results.

Frequently asked questions

Does the Corlen Shopify app work on a Hydrogen storefront?

Do not count on it. The Corlen Shopify app is a theme app block you add in the theme editor, and that depends on an Online Store 2.0 theme. A custom Hydrogen storefront has no theme editor, so the Corlen API is the route there.

Can I keep my Shopify catalog and still use the API?

Yes. Your products stay in Shopify. Your storefront reads the garment image from the Storefront API as usual and passes it, with the shopper photo, to your own server route, which calls the Corlen API.

Where should the API key go on a Hydrogen store?

In a server only environment variable, used inside a route or action that runs on the server. Never in a component that ships to the browser, because anyone can read browser code.

Are shopper photos stored when I use the Corlen API?

No. On the API, shopper photos are processed and not saved. Your own server route should follow the same rule and avoid logging or storing the upload.

Ready to add real try-on to your store?

Install Corlen on Shopify in minutes, or build it into your own platform with the developer API.

Similar posts

See it on your own photo

Corlen shows your customers how any garment looks on their own body, in seconds. Try it free, no account needed.

Try Corlen free