@agentshop/seo/next/pages.
Product pages
Fetch the bundle ingetServerSideProps, render it with <ProductHead>:
pages/products/[handle].tsx
getProductSeoProps(ctx, config?)readsctx.params.handleand returns{ props: { seo: SeoBundle | null } }. Merge it into your own props if you already have agetServerSideProps.<ProductHead seo />renders everything intonext/head: title, description, canonical, Open Graph (includingog:type=product— unlike the App Router, raw meta tags accept it), Twitter tags, and the escaped JSON-LD script. Withseo={null}it renders nothing.
Sitemap
pages/sitemap.xml.ts
pages/api/sitemap.xml.ts
Content-Type: application/xml; charset=utf-8 and Cache-Control: public, max-age=3600, stale-while-revalidate=86400, and responds 200 with the XML or 502 with an empty body when unavailable.
Configuration
Both helpers accept an optionalSeoClientConfig as their last argument; environment variables AGENTSHOP_API_KEY and AGENTSHOP_SEO_URL fill anything you don’t pass. AGENTSHOP_API_KEY is a secret — both helpers run server-side (getServerSideProps / an API route), so keep it in a server-side env var, never a NEXT_PUBLIC_* one. All helpers follow the never-throw contract.
