@agentshop/seo/next.
All helpers read AGENTSHOP_API_KEY and AGENTSHOP_SEO_URL from the environment, cache with ISR (revalidate: 3600) by default, and return nothing on any failure — your page never 500s because of SEO. See Concepts.
Product pages
app/products/[handle]/page.tsx
createProductMetadata(config?)is a factory returning a readygenerateMetadata. Use the factory whenever you pass config — it avoids colliding with Next’s positionalgenerateMetadata(props, parent)signature. If you need zero config, you can also exportgenerateProductMetadatadirectly.<ProductJsonLd handle config? />is an async server component: it renders the<script type="application/ld+json">withProduct+BreadcrumbList, or nothing if the bundle is unavailable.- Both support Next 14 (sync
params) and Next 15/16 (Promiseparams).
Collection pages
app/collections/[handle]/page.tsx
CollectionPage + ItemList + breadcrumb JSON-LD, with og:type=website semantics in the bundle. See Collection JSON-LD.
Home page (site-level JSON-LD)
app/page.tsx
Organization + WebSite (+ FAQPage when your store has published FAQs) graph. Inject it once, on the home page only. See Site-level JSON-LD.
Sitemap
app/sitemap.xml/route.ts
Passing configuration
Every factory and component accepts an optionalSeoClientConfig:
AGENTSHOP_API_KEY, AGENTSHOP_SEO_URL) are used for anything you don’t pass explicitly. AGENTSHOP_API_KEY is a secret — keep it in a server-side env var, never a NEXT_PUBLIC_* one. Every helper here runs on the server, so the key never reaches the browser.
Full export list
See the Next.js API reference for exact signatures ofgenerateProductMetadata, createProductMetadata, generateCollectionMetadata, createCollectionMetadata, ProductJsonLd, CollectionJsonLd, SiteJsonLd, productSitemapRoute, and toNextMetadata.
