Categories
Retrieve categories with the hive-cms SDK
Use categories to power nav, sidebars, and content grouping.
SDK usage
import { Hive } from 'hive-cms';
const hive = new Hive();
const categories = await hive.categories.list();Example
const links = categories.map((category) => ({
href: `/category/${category.slug}`,
label: category.name,
}));Error handling
hive.categories.list() throws HiveApiError on API/network issues and malformed payloads.
Technical notes
- Feed category slugs into
hive.posts.list({ category: 'slug' }). - SDK validates category payloads before returning data.