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-predictive-search

Skill by Shopify

Guides developers building predictive search, the autocomplete UI, in Shopify Hydrogen storefronts. It covers the route handler, client store, tracked result links and custom fragments, and is for anyone adding or reviewing search-as-you-type features.

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

Install hydrogen-predictive-search

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-predictive-search ~/.claude/skills/hydrogen-predictive-search

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

Step-by-step: install hydrogen-predictive-search in Claude Code

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

About

This skill describes how to build predictive search with the @shopify/hydrogen package. Hydrogen predictive search has four layers: a Storefront API query helper, a same-origin route at /api/predictive-search, a framework-neutral client store, and framework provider or hook bindings. Rendering stays app-owned, because Hydrogen supplies data, state, request lifecycle and URL helpers rather than a dropdown template.

The skill explains how to register the packaged route handler, build result links with getPredictiveSearchItemUrl() so tracking parameters are kept, and add custom fragments for extra result fields. It also sets rules, such as keeping search usable without JavaScript through a /search link or GET form, using the q parameter, and returning empty UI for blank terms. It is intended for developers building or reviewing search in Hydrogen storefronts.

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

What it can do

  • Server route handlerRegisters the packaged predictive search route handler at /api/predictive-search in the app's request wiring.
  • Tracking URLsBuilds predictive result links with getPredictiveSearchItemUrl() so Storefront API trackingParameters are preserved.
  • Custom fragmentsAdds extra result fields to predictive search queries through additive fragments.
  • Typed client stateDerives client state types from the server handlers so the UI sees custom fields.
  • Framework bindingsPoints framework providers and hooks or composables at the shared predictive search route and store.
  • No-JavaScript fallback rulesRequires a real /search link or GET form so search results render server-side without JavaScript.
  • Modal dismiss guidanceExplains how to close a native dialog modal on backdrop clicks without accidental closes from drags.

What you need

  • @shopify/hydrogen package
  • Storefront API client for the app
  • Hydrogen request handler setup from the hydrogen-request-handlers skill

Try asking

  • Add predictive search with the packaged /api/predictive-search route to my Hydrogen app.
  • Build predictive result links with getPredictiveSearchItemUrl() that keep tracking parameters.
  • Add a custom product vendor field to my predictive search results using a fragment.

Good to know

  • Hydrogen provides no dropdown template; the UI is app-owned.
  • The client does not validate route responses.
  • Predictive autocomplete must enhance a working /search page, not replace it.
  • Custom Shopify resource paths need the hydrogen-routing skill for result URLs.

Security check

A

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

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

Alternatives to hydrogen-predictive-search

All alternatives →

Compare with shopify, shopify-development or ticketmaster

hydrogen-predictive-search: common questions

Does Hydrogen predictive search work without JavaScript?

The skill requires a real /search link or role="search" GET form so shoppers reach server-rendered results. Predictive autocomplete is an enhancement on top of that path.

How are predictive result links built?

Use getPredictiveSearchItemUrl(), which infers the standard storefront route from the item type and keeps tracking parameters without double-encoding.

Can I add custom fields to predictive search results?

Yes. The skill recommends additive fragments over full query overrides, and Hydrogen composes them with required base fields.

How do I install hydrogen-predictive-search?

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

Is hydrogen-predictive-search free?

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

Is hydrogen-predictive-search safe to use?

It scores 85 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-predictive-search?

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

hydrogen-predictive-search Install

Add to stack

Loading.