@agentshop/seo/next (App Router)
All App Router helpers default to ISR caching ({ next: { revalidate: 3600 } }), overridable via config.fetchOptions. Metadata helpers support Next 14 (sync params) and Next 15/16 (Promise params).
Metadata
generateMetadata for app/products/[handle]/page.tsx:
generateMetadata. Use this whenever you pass config — it avoids the positional-argument collision with Next’s generateMetadata(props, parent) call signature.
All App Router metadata omits
og:type — "product" isn’t in Next’s typed Metadata union and throws at runtime. All other Open Graph tags render with property="og:*".Components
<script type="application/ld+json">, or null when the bundle is unavailable. SiteJsonLd belongs on the home page only.
Routes
app/sitemap.xml/route.ts:
Content-Type: application/xml; charset=utf-8 (no Cache-Control header — caching is via ISR).
Re-exports
Metadata mapper, for wiring metadata yourself — see Core API.
@agentshop/seo/next/pages (Pages Router)
getServerSideProps helper — reads the handle from route params and returns the bundle as a seo prop.
next/head: title, description, canonical, Open Graph (including og:type=product — raw meta accepts it), Twitter, and the escaped JSON-LD script. Renders nothing for null.
pages/sitemap.xml.ts or an API route:
Content-Type: application/xml; charset=utf-8 and Cache-Control: public, max-age=3600, stale-while-revalidate=86400.
Remix and Hydrogen exports
Documented in their framework guides: Remix (loadProductSeo(handle, config?), agentshopProductMeta, productSitemapLoader) and Hydrogen (same names, but loadProductSeo(context, handle, config?) and a context-aware sitemap loader).
