List Categories
Retrieve all product categories.
Updated
On this page
Overview
Fetch all categories for navigation menus, sidebars, and filter UIs. Categories support nesting (parent/child) for hierarchical navigation.
SDK Usage
import dash from "@/lib/dash"
// Flat list of all categories
const { categories } = await dash.categories.list()
// Nested tree structure
const { categories: tree } = await dash.categories.getTree()
// Categories at a specific depth
const { categories: topLevel } = await dash.categories.getByDepth(0)
// Children of a specific category
const { categories: children } = await dash.categories.getChildren("flower")