Product SEO
Meta titles, descriptions, and Open Graph data for products.
Updated
On this page
Overview
Fetch SEO metadata for product pages to set meta tags, Open Graph data, and structured data (JSON-LD).
SDK Usage
import dash from "@/lib/dash"
const { seo } = await dash.seo.product("blue-dream")
// seo = {
// title: "Blue Dream | My Store",
// description: "Premium Blue Dream flower...",
// keywords: "blue dream, flower, sativa",
// og_image: "https://cdn.dashfordevs.com/...",
// schema: { "@type": "Product", ... },
// canonical_slug: "blue-dream"
// }
Next.js generateMetadata
// app/products/[slug]/page.tsx
import dash from "@/lib/dash"
export async function generateMetadata({ params }) {
const { seo } = await dash.seo.product(params.slug)
return {
title: seo.title,
description: seo.description,
keywords: seo.keywords,
openGraph: {
title: seo.title,
description: seo.description,
images: seo.og_image ? [seo.og_image] : [],
},
}
}
JSON-LD Structured Data
// Add to product page for rich search results
export default async function ProductPage({ params }) {
const { seo } = await dash.seo.product(params.slug)
return (
<>
{seo.schema && (
<script type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(seo.schema) }} />
)}
{/* ... page content ... */}
</>
)
}
REST API
GET /storefront/seo/product/blue-dream
X-API-Key: pk_live_your_key
Next Steps
- Category SEO — Category page meta tags
- Blog SEO — Blog post meta tags
- Sitemap — Generating sitemaps
For the strategy these fields serve rather than the fields themselves, see ecommerce SEO.