Alokai

getCategoryTree

Fetches a category tree.

This method sends a GET request to the getCategoryTree endpoint of the Vue Storefront API Middleware. In turn, it receives data from the getCategoryTree endpoint exposed by the BigCommerce API

Signature

declare function getCategoryTree$1(
	props?: GetCategoryTreeParameters,
	options?: MethodOptions
): Promise<GetCategoryTreeResponse>;

Parameters

NameRequiredTypeDescription
propsOptionalGetCategoryTreeParameters
optionsOptionalMethodOptions

Returns

Returns a response with the category tree data.

Referenced Types

Examples

Fetching category that matches the id from the query.

import { sdk } from '~/sdk.config.ts';

const categoryTree = await sdk.bigcommerce.getCategoryTree();

Fetching category that matches the id from the query. Sending it this way, the response can be cached safely.

import { sdk } from '~/sdk.config.ts';

const channel = ...
const categoryTree = await sdk.bigcommerce.getCategoryTree({ channel });

On this page