Composables
The product detail feature provides composables that provide logic for the core product detail features, such utilities and SEO data manipulation. Available through the corresponding NPM module @scayle/storefront-product-detail
these composables come with configurable parameters to help implement the feature in your project.
useProductSeoData
A composable function to generate SEO-related data for a product page.
Parameter
breadcrumbs
(Required) Array of breadcrumb items representing the navigation path to the product.
urlParams
(Required) Object containing baseUrl and fullPath to build and sanitize canonicalUrl.
images
(Required) Array of image URLs for the product.
productInfo
(Required) Object containing product information including name, brand, description, and variants.
Returns
robots
Robots meta tag value, typically "index, follow".
canonicalLink
Computed ref for canonical link tag metadata.
title
The title of the product.
productJsonLd
Computed ref containing JSON-LD structured data for the product.
productBreadcrumbJsonLd
Computed ref containing JSON-LD structured data for product breadcrumbs.