Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

hydrogen-markets

Skill by Shopify

Guides developers through adding Shopify Markets to a Hydrogen storefront. It covers market routing, country and language localization, and Storefront API @inContext wiring for path-prefixed or per-market domain setups.

  • Score 90
  • 2.2k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install hydrogen-markets

Built from the published package, never by AI.

git clone --depth 1 https://github.com/Shopify/hydrogen /tmp/hydrogen && mkdir -p ~/.claude/skills && cp -r /tmp/hydrogen/packages/hydrogen/skills/hydrogen-markets ~/.claude/skills/hydrogen-markets

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install hydrogen-markets in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

The hydrogen-markets skill is a guide from Shopify for adding Shopify Markets to a Hydrogen storefront. It explains how to define the storefront's locales once with defineShopifyI18n and pass that definition to createShopifyRequestContext, so each request's locale is resolved from the URL. Queries that declare $country and $language with @inContext receive those values from the resolved locale.

It covers two routing types: pathname prefixes such as /fr-ca, and per-market domains or subdomains. It also covers locale switchers, hreflang alternate links, LocaleProvider for browser requests, and Next.js App Router market routing. It is written for developers building Hydrogen storefronts that sell across several countries and languages.

Written from the project's SKILL.md and checked against it.

What it can do

  • defineShopifyI18nDefines the storefront's default locale and routing once, validated at module load.
  • createShopifyRequestContextResolves the request's locale from the i18n definition for use by the Storefront client.
  • Pathname routingEncodes the locale in the first path segment, such as /fr-ca/products/shirt.
  • Domain routingMaps each locale to its own hostname, such as example.ca or fr.example.com.
  • LocaleProviderPasses the request locale to cart, predictive search and account components in the browser.
  • Locale switchers and hreflangUses getLocalizedHref, getSupportedLocales and isSameLocale to build switcher and alternate links.
  • @inContext wiringInjects country and language into Storefront API queries that declare them.

What you need

  • A Hydrogen storefront
  • Storefront API store domain and public token
  • Next.js App Router, if using that setup

Try asking

  • Set up pathname market routing with /fr-ca for Canada in French
  • Add a locale switcher and hreflang links to my Hydrogen storefront
  • Wire @inContext country and language into my Storefront API query

Good to know

  • Cookie, geolocation and buyer-preference routing are not built-in routing types.
  • Changing locale requires a full page load, because the cart is priced for one market per load.
  • Next.js Server Components do not receive a full Request, so the locale comes from a header or an explicit override.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: packages/hydrogen/skills/hydrogen-markets/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md17 KB
  • references/nextjs.md5 KB

Alternatives to hydrogen-markets

All alternatives →

Compare with shopify, shopify-development or ticketmaster

hydrogen-markets: common questions

How does Hydrogen decide which market a request uses?

The URL is the only input to locale resolution. defineShopifyI18n describes the locales, and createShopifyRequestContext resolves the request's locale from that definition.

Can each market use its own domain?

Yes. Use type domain with a hostname for each locale. Matching is exact on the hostname, and pathPrefix is always empty under domain routing.

Why are hreflang tags not built from language and country directly?

Regional language codes such as PT_BR already include a region, so joining them with the country would produce invalid tags like pt-br-BR. The skill maps them to valid BCP 47 tags.

How do I install hydrogen-markets?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is hydrogen-markets free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is hydrogen-markets safe to use?

It scores 90 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to hydrogen-markets?

Similar skills: shopify, shopify-development, ticketmaster, seo-ecommerce.

hydrogen-markets Install

Add to stack

Loading.