@agentshop/seo/hydrogen.
Setup
Add both variables to your storefront environment (Shopify admin → Hydrogen storefront → environment variables, and.env for local shopify hydrogen dev):
Product routes
app/routes/products.$handle.tsx
loadProductSeo(context, handle, config?)— note the Oxygencontextcomes first. Returns{ agentshopSeo: SeoBundle | null }; spread it into your loader data under that exact key. An explicitconfigwins overcontext.env.agentshopProductMeta(args)is identical to the Remix version: a v2metafunction readingdata.agentshopSeo, emitting title, description, canonical, Open Graph (includingog:type=product), Twitter tags, and JSON-LD via"script:ld+json". Returns an empty array when the bundle isnull.
Sitemap
app/routes/[sitemap.xml].ts
args.context to resolve your environment — no config needed. It returns 200 XML with Cache-Control: public, max-age=3600, stale-while-revalidate=86400, or 502 with an empty body when unavailable.
Troubleshooting: works locally, empty on Oxygen
This is almost always environment resolution. Check that:AGENTSHOP_API_KEYandAGENTSHOP_SEO_URLare set on the Hydrogen storefront environment (not just your local.env).- No custom code reads
process.env— on Oxygen it doesn’t exist.

