Install the package
Set your environment variables
Add both variables to
.env.local (and to your deploy platform’s environment):.env.local
Find your store API key (
ask_…) in the AgentShop dashboard under Settings → API Keys — one key per store. It’s a secret: keep it in a server-side env var only (never a NEXT_PUBLIC_* variable or client code). The SDK uses it only on the server, so nothing is exposed to the browser.Add two lines to your product page
app/products/[handle]/page.tsx
createProductMetadata() returns a ready generateMetadata that renders the title, meta description, canonical, Open Graph, and Twitter tags. <ProductJsonLd> is an async server component that renders the Product + BreadcrumbList JSON-LD script. Both work with Next 14 (sync params) and Next 15/16 (Promise params) — no version-specific code needed.Optionally add the sitemap route:app/sitemap.xml/route.ts
Verify
Open a product page and use View Source (
Ctrl+U / Cmd+Option+U) — not the DevTools Elements panel. DevTools shows the hydrated DOM; crawlers see the initial HTML, which is what View Source shows.You should see:- A real
<title>and<meta name="description">from your Shopify SEO fields <link rel="canonical">,og:*, andtwitter:*tags- A
<script type="application/ld+json">block withProductandBreadcrumbList
Where to go next
- Add collection pages and the site-level JSON-LD on your home page (App Router).
- Read Concepts for how bundles, caching, and graceful degradation work.
- Something not rendering? See Troubleshooting.

