• Модуль интеграций
  • Сообщество
  • Блог
Документация
Плагины и интеграцииВсе расширения для Medusa от сообществаСтартерыЗапускайте проекты быстрее с готовыми решениями
ЭкспертыПодберите специалиста для разработки и развития вашего проекта на MedusaКейсыПосмотрите примеры Medusa в продакшене и успешные внедрения
Меч Moscow
Комплексная e-commerce платформа на Medusa для московского fashion-бренда

Меч Moscow · Fashion

Gorgo снижает затраты на адаптацию Medusa к локальным рынкам.

Мы разрабатываем плагины интеграции, осуществляем поддержку и развиваем сообщество разработчиков на Medusa в Telegram.

  • Ресурсы Medusa
  • Плагины и интеграции
  • Модуль интеграций
  • Стартеры
  • Эксперты
  • Кейсы
  • Medusa Чат в Telegram
  • Medusa Новости в Telegram
  • Документация Gorgo
  • Связаться с нами
  • TelegramGitHub
Плагины
B

Brand

Commercial-grade Brand Management plugin for Medusa v2 — full CRUD, Module Link-based product assignment, Admin and Store REST APIs, and an Admin dashboard UI.

npm install @mgtalabs/medusa-brand
Категория
Другое
Создано
Mgtalabs
Версия
0.1.1
Последнее обновление
2 дня назад
Ежемесячные загрузки
Загрузка данных
Звезды на Github
0
npmNPMGitHubGithub

@mgtalabs/medusa-brand

A commercial-grade Brand Management plugin for Medusa v2 — full CRUD with soft delete/restore, a one-brand-to-many-products relationship built on Medusa's official Module Link system, Admin and Store REST APIs, an Admin dashboard UI, and events other plugins can subscribe to.

Compatibility

Built and tested against Medusa 2.18.0. Requires , , and the other packages listed under to already be present in the consuming application (they are, for any standard Medusa v2 project).

Features

  • Brand CRUD: create, update, soft delete + restore, permanent delete
  • One brand → many products, via a Module Link (not a direct foreign key — see docs/architecture.md in the workspace for why)
  • Assign a brand at product-creation time through the normal Admin product form (), or manage assignment after the fact from either side — the product's Admin page (see below), the brand's own detail page, or via the Brand's product endpoints directly
  • Storage-provider-agnostic logo/banner fields (plain URL + file id — works with local, S3, MinIO, Cloudinary, or any configured Medusa File Module provider)
  • Bulk delete/restore
  • Search ( param), status/featured filtering, pagination and sorting on all list endpoints
  • Admin dashboard: a Brands list, a Brand detail page (edit brand fields, plus a searchable/paginated multi-select product picker to assign, add, or remove products in bulk), a "Products" section in the Create Brand form to assign products at creation time, and a Product-detail widget for assigning, changing, or removing that product's brand from the product's own page
  • Configurable via plugin options: , ,
  • Events (, , , ) and workflow hooks (, ) for other plugins to build on

Installation

npm install @mgtalabs/medusa-brand

Register it in your Medusa application's :

1module.exports = defineConfig({
2 // ...
3 plugins: [
4 {
5 resolve: "@mgtalabs/medusa-brand",
6 options: {
7 enableSEO: true,
8 enableFeaturedBrands: true,
9 logoRequired: false,
10 },
11 },
12 ],
13})

Then run migrations to create the table and sync the product-brand link:

npx medusa db:migrate

Configuration

OptionTypeDefaultEffect
Governs whether / are exposed in the admin form/API surface. The columns always exist regardless, to avoid schema drift if you flip this later.
Governs whether the filter and are meaningfully used in your storefront.
When , brand creation is rejected () if isn't provided.

Admin API

All routes are under and require the standard Medusa admin authentication — nothing extra to configure.

MethodPathDescription
List brands. Query: , , , , ,
Create a brand
Get a brand
Update a brand
Soft delete (default); pass for a hard delete
Restore a soft-deleted brand
Bulk delete/restore:
List a brand's products (paginated)
Assign products:
Remove products:

Brand fields: , (auto-derived from if omitted), , , , , , , , , , , (/), .

Assigning a brand at product-creation time

1POST /admin/products
2{
3 "title": "...",
4 ...
5 "additional_data": { "brand_id": "brand_123" }
6}

Store API

Public routes, gated by a publishable API key like any other store route.

MethodPathDescription
List active brands. Query: , , , ,
Convenience alias for
Get a brand by id or slug (same handler resolves either)
List a brand's products

Events

EventPayload

Subscribe from any plugin:

1// src/subscribers/brand-created.ts
2import type { SubscriberArgs, SubscriberConfig } from "@medusajs/framework"
3
4export default async function brandCreatedHandler({
5 event: { data },
6}: SubscriberArgs<{ id: string }>) {
7 // ...
8}
9
10export const config: SubscriberConfig = { event: "brand.created" }

Extension points

Beyond events, and expose hooks for synchronous, transactional extensibility:

1import { createBrandWorkflow } from "@mgtalabs/medusa-brand/workflows/create-brand"
2
3createBrandWorkflow.hooks.brandCreated(async ({ brand }, { container }) => {
4 // runs inside the same workflow transaction
5})

The Module Link itself is also queryable by any other plugin.

Known limitations

  • Filtering core's or by directly is not supported — Medusa doesn't document a way to extend a core route's query validator from a plugin. Use this plugin's own / instead.
  • returns whatever products are linked regardless of their own publish status — Medusa's Query layer doesn't support filtering by a linked model's property (confirmed against current docs), only by the link table's own columns.
  • HTTP-level integration tests for this plugin live in the consuming application's own test suite, not this package's — 's has an open upstream bug when configured at the plugin level (medusajs/medusa#11863). Module-level tests () are unaffected and ship in .

License

Proprietary — see the workspace root LICENSE. Free during the current evaluation period; see the workspace's for the licensing/pricing model.

Еще в этой категории

Посмотреть все
Другое
Gati logo

Gati

От Devx Commerce

Синхронизируйте Medusa с Gati ERP

Загрузка данных
npm
Другое
Product Reviews logo

Product Reviews

От Lambda Curry

Добавляйте рейтинги, отзывы и модерацию товаров

Загрузка данных
GitHubnpm
Другое
Variant Images logo

Variant Images

От Betanoir

Организуйте и загружайте варианты изображений в Medusa

Загрузка данных
GitHubnpm