> ## Documentation Index
> Fetch the complete documentation index at: https://86d.store/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Brands

> Reference for @86d-store/brands: organize products by manufacturer or brand with dedicated brand pages, featured listings, and SEO metadata.

<Warning>
  **Experimental.** This Module has no test or production evidence recorded yet. Read it, run it locally, and hold off on real Orders. See [maturity levels](/docs/resources/versioning).
</Warning>

The Brands [Module](/docs/concepts/modules) organizes products by manufacturer or brand. You create brand records with logos, banner images, and SEO metadata, then assign products to them. The [Storefront](/docs/concepts/storefront) gets dedicated brand pages and featured brand listings. A product belongs to exactly one brand, so filtering catalog queries by brand stays unambiguous.

**Source:** [`modules/brands`](https://github.com/86d-store/86d/tree/main/modules/brands) · **npm:** [`@86d-store/brands`](https://www.npmjs.com/package/@86d-store/brands)

## Installation

<CodeGroup>
  ```sh npm theme={null}
  npm install @86d-store/brands
  ```

  ```sh pnpm theme={null}
  pnpm add @86d-store/brands
  ```
</CodeGroup>

Then register the Module in your store's `config.json`:

```json theme={null}
{
  "modules": ["@86d-store/brands"],
  "advanced": {
    "version": 1,
    "allowExperimentalModules": true
  }
}
```

## Configuration

```ts theme={null}
import brands from "@86d-store/brands";

const module = brands({
  maxProductsPerPage: "100",
});
```

<ParamField body="maxProductsPerPage" default="&#x22;100&#x22;" type="string">
  Maximum number of products returned by the brand products endpoint. This value is a string for module config compatibility.
</ParamField>

## Store endpoints

Store endpoints are public and return only active brands. Inactive brands are hidden from the Storefront.

| Method | Path                         | Description                                                   |
| ------ | ---------------------------- | ------------------------------------------------------------- |
| `GET`  | `/brands`                    | List active brands, paginated and filterable by featured flag |
| `GET`  | `/brands/featured`           | Get featured brands with optional `limit` query param         |
| `GET`  | `/brands/:slug`              | Get a single brand by slug                                    |
| `GET`  | `/brands/:slug/products`     | Get paginated products for a brand                            |
| `GET`  | `/brands/product/:productId` | Get the brand associated with a specific product              |

## Admin endpoints

Admin endpoints require authentication and return brands of all statuses.

| Method | Path                                  | Description                                     |
| ------ | ------------------------------------- | ----------------------------------------------- |
| `GET`  | `/admin/brands`                       | List all brands, paginated and filterable       |
| `GET`  | `/admin/brands/stats`                 | Get brand statistics                            |
| `POST` | `/admin/brands/create`                | Create a new brand                              |
| `POST` | `/admin/brands/:id/update`            | Update a brand                                  |
| `POST` | `/admin/brands/:id/delete`            | Delete a brand and all its product associations |
| `GET`  | `/admin/brands/:id/products`          | List products for a brand                       |
| `POST` | `/admin/brands/:id/products/assign`   | Assign products to a brand                      |
| `POST` | `/admin/brands/:id/products/unassign` | Unassign products from a brand                  |

## Components

Add these components to your MDX [Template](/docs/concepts/templates) files. The `brands` Module must be listed in `config.json`.

### `BrandList`

Renders a grid of active brands. Fetches its own data.

<ParamField body="limit" type="number">
  Maximum number of brands to display.
</ParamField>

```mdx theme={null}
<BrandList />

<BrandList limit={12} />
```

***

### `FeaturedBrands`

Renders a row or grid of featured brands. Fetches its own data.

<ParamField body="limit" type="number">
  Maximum number of featured brands to display.
</ParamField>

```mdx theme={null}
<FeaturedBrands />

<FeaturedBrands limit={6} />
```

## Types

```ts theme={null}
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.

## Related pages

* [Products](/docs/modules/products)
* [Collections](/docs/modules/collections)
* [Versioning and maturity](/docs/resources/versioning)
* [Glossary](/docs/resources/glossary)
