Skip to main content

Documentation Index

Fetch the complete documentation index at: https://86d.app/docs/llms.txt

Use this file to discover all available pages before exploring further.

The brands module organizes products by manufacturer or brand. You create brand records with logos, banner images, and SEO metadata, then associate products with a brand. On the storefront, you get dedicated brand pages and featured brand listings. Because a product belongs to exactly one brand, the module also makes it easy to filter catalog queries by brand. Source: modules/brands · npm: @86d-app/brands

Installation

npm install @86d-app/brands
Then register the module in your store’s config.json:
{
  "modules": ["@86d-app/brands"]
}

Configuration

import brands from "@86d-app/brands";

const module = brands({
  maxProductsPerPage: "100",
});
maxProductsPerPage
string
default:"\"100\""
Maximum number of products returned by the brand products endpoint. This value is a string for module config compatibility.

Store endpoints

Store endpoints are public and return only active brands. Inactive brands are hidden from the storefront.
MethodPathDescription
GET/brandsList active brands, paginated and filterable by featured flag
GET/brands/featuredGet featured brands with optional limit query param
GET/brands/:slugGet a single brand by slug
GET/brands/:slug/productsGet paginated products for a brand
GET/brands/product/:productIdGet the brand associated with a specific product

Admin endpoints

Admin endpoints require authentication and return brands of all statuses.
MethodPathDescription
GET/admin/brandsList all brands, paginated and filterable
GET/admin/brands/statsGet brand statistics
POST/admin/brands/createCreate a new brand
POST/admin/brands/:id/updateUpdate a brand
POST/admin/brands/:id/deleteDelete a brand and all its product associations
GET/admin/brands/:id/productsList products for a brand
POST/admin/brands/:id/products/assignAssign products to a brand
POST/admin/brands/:id/products/unassignUnassign products from a brand

Components

Add these components to your MDX template files. The brands module must be listed in config.json.

BrandList

Renders a grid of active brands. Fetches its own data.
limit
number
Maximum number of brands to display.
<BrandList />

<BrandList limit={12} />

FeaturedBrands

Renders a row or grid of featured brands. Fetches its own data.
limit
number
Maximum number of featured brands to display.
<FeaturedBrands />

<FeaturedBrands limit={6} />

Types

interface Brand {
  id: string;
  name: string;
  slug: string;
  description?: string;
  logo?: string;
  bannerImage?: string;
  website?: string;
  isActive: boolean;
  isFeatured: boolean;
  position: number;
  seoTitle?: string;
  seoDescription?: string;
  createdAt: Date;
  updatedAt: Date;
}

interface BrandProduct {
  id: string;
  brandId: string;
  productId: string;
  assignedAt: Date;
}

interface BrandStats {
  totalBrands: number;
  activeBrands: number;
  featuredBrands: number;
  totalProducts: number;
}

Notes

  • A product can belong to only one brand. Assigning a product to a new brand automatically removes it from its previous brand.
  • Store endpoints return only active brands. getBrandForProduct returns null for inactive brands.
  • Deleting a brand cascades and removes all associated BrandProduct records.
  • Bulk assign and unassign operations are idempotent. Already-assigned products are skipped, and the return value is the count of new assignments only.