Skip to content

usePDP

The usePDP hook allows you to access pdp data and perform mutations that will reflect on other entities within the Sales App data layer.

Usage

src/index.tsx
import { usePDP } from '@vtex/sales-app'
const Product= () => {
const { productSku } = usePDP()
return <div>Product name: {productSku?.name}</div>
}

Parameters

The usePDP hook does not receive any parameters.

Returns

The usePDP hook returns an object with the following properties:

productSku

Extension Points

This hook is available in the following extension points:

  • pdp.sidebar.before
  • pdp.sidebar.after
  • pdp.content.after

For a full list of available extension points, refer to the ExtensionPoints page.