getProducts
Fetches details of a product from BigCommerce store.
This method sends a GET request to the getProducts endpoint of the Vue Storefront API Middleware. In turn, it receives data from the getProducts endpoint exposed by the BigCommerce API
Signature
declare function getProducts(
props: GetProductsParameters,
options?: MethodOptions
): Promise<ProductsResponse>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
props | Required | GetProductsParameters | Parameter object which can be used with this method. Refer to its type definition to learn about possible properties. |
options | Optional | MethodOptions |
Returns
Returns a response with the matching products data.
Referenced Types
Examples
Fetching product that match the name in the query.
import { sdk } from '~/sdk.config.ts';
const product = await sdk.bigcommerce.getProducts({ name: 'Suitcase' });Fetching product that match the name in the query. Sending it this way, the response can be cached safely.
import { sdk } from '~/sdk.config.ts';
const channel = ...
const product = await sdk.bigcommerce.getProducts({ name: 'Suitcase', channel });