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

Меч Moscow · Fashion

Нужна помощь в разработке плагина интеграции для Medusa?

Написать намНайти плагины

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

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

  • Ресурсы Medusa
  • Плагины и интеграции
  • Эксперты
  • Кейсы
  • Medusa Чат в Telegram
  • Medusa Новости в Telegram
  • Документация Gorgo
  • Связаться с нами
  • head@gorgojs.com
  • TelegramGitHub
MedusaПлагиныAthos plugin
A

Athos plugin

Medusa Athos Integration Plugin.

Нужна доработка этого плагина?

Связаться с нами
npm install @weareseeed/medusa-athos-plugin
Категория
Поиск
Создано
Weareseeed
Версия
0.0.3
Последнее обновление
19 часов назад
Ежемесячные загрузки
309
Звезды на Github
0
npmNPM
MedusaПлагиныAthos plugin

@weareseeed/medusa-athos-plugin

Medusa v2 plugin that generates a streaming NDJSON product feed for Athos Commerce integration.

Features

  • Streaming NDJSON product feed (one line per variant + one product summary line)
  • Token-based feed authentication
  • Price filtering by region
  • Product filtering by sales channel
  • Configurable swatch options
  • Extensible via and hooks
  • Admin API to manage plugin configuration

Requirements

  • Medusa v2
  • Node.js >= 20

Installation

yarn add @weareseeed/medusa-athos-plugin

Setup

1. Register the plugin

// medusa-config.ts
import { defineConfig } from "@medusajs/framework/config"
export default defineConfig({
plugins: [
{
resolve: "@weareseeed/medusa-athos-plugin",
options: {},
},
],
})

2. Run migrations

npx medusa db:migrate

3. Configure via Admin API

Set the plugin configuration through the authenticated admin endpoint:

curl -X POST http://localhost:9000/admin/athos/config \
-H "Authorization: Bearer <admin_token>" \
-H "Content-Type: application/json" \
-d '{
"storefront_url": "https://mystore.com",
"feed_token": "a-secret-token",
"region_id": "reg_01...",
"sales_channel_ids": ["sc_01..."],
"swatch_option_titles": ["color", "colour"]
}'
FieldTypeRequiredDescription
YesBase URL prepended to for each product URL
YesSecret token required to access the feed endpoint
NoWhen set, prices are filtered to the region's currency
NoWhen set, only products in these sales channels are included
NoOption titles treated as swatches (default: )

Feed Endpoint

Returns an stream. Each product produces:

  1. One variant line per variant
  2. One product summary line

Variant line fields

FieldDescription
Variant ID
Variant SKU
Variant title
Lowest price for the variant (filtered by region if configured)
Product thumbnail
Product description
Array of category path strings (e.g. )
Array of category IDs
Comma-separated product tags
Parent product ID
Parent product title
Parent product thumbnail
1-based position within the product
if the variant is available
% of variants in stock across the product
All product options with positions and values
This variant's chosen option values
Values of configured swatch options (product-level)

Product summary line fields

Same as variant line minus all private fields, with set to the product ID and set to the lowest price across all variants.

Example

{"Product ID":"variant_01...","SKU":"1","Name":"blue, m","Product URL":"https://mystore.com/products/example","Price":10,"Thumbnail URL":"https://...","Description":"...","Category":["Tops"],"Category ID":["pcat_01..."],"__parent_id":"prod_01...","__parent_title":"Example Product","__parent_image":"https://...","__variant_position":1,"__in_stock":true,"__in_stock_pct":100,"__standard_options":{"color":{"position":0,"values":["red","blue"]},"size":{"position":1,"values":["s","m"]}},"__selected_options":{"color":{"value":"blue"},"size":{"value":"m"}},"__swatch_options":{"red":{"value":"red"},"blue":{"value":"blue"}}}
{"Product ID":"prod_01...","Name":"Example Product","Product URL":"https://mystore.com/products/example","Price":10,"Thumbnail URL":"https://...","Description":"...","Category":["Tops"],"Category ID":["pcat_01..."]}

Plugin Options

Pass options when registering the plugin in to extend the feed.

import { defineConfig } from "@medusajs/framework/config"
import type { FeedLineContext } from "@weareseeed/medusa-athos-plugin/types"
export default defineConfig({
plugins: [
{
resolve: "@weareseeed/medusa-athos-plugin",
options: {
feed: {
extraProductFields: ["metadata", "variants.metadata"],
transformLine: (line, ctx: FeedLineContext) => {
line["Brand"] = (ctx.product as any).metadata?.brand ?? undefined
if (ctx.type === "variant") {
line["Custom Variant Field"] = (ctx.variant as any).metadata?.custom ?? undefined
}
if (ctx.type === "product") {
line["Custom Product Field"] = (ctx.product as any).metadata?.custom ?? undefined
}
return line
},
},
},
},
],
})

— Additional Medusa product fields to fetch and make available inside . Uses the same dot-notation field paths as Medusa's .

extraProductFields: [
"metadata",
"variants.metadata",
"images.url",
"collection.title",
]

(line: Record<string, unknown>, ctx: FeedLineContext) =>
Record<string, unknown> | Promise<Record<string, unknown>>

Called for every line written to the feed. Use it to add, remove, or transform fields. The argument provides typed access to the raw product and variant data:

type FeedLineContext =
| { type: "variant"; product: Record<string, unknown>; variant: Record<string, unknown>; variantIndex: number }
| { type: "product"; product: Record<string, unknown> }

Fields that resolve to are automatically stripped from the output.

Admin API

Both endpoints require an authenticated admin JWT.

MethodPathDescription
Retrieve the current configuration
Create or update the configuration

License

MIT — Seeed

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

Посмотреть все
Поиск
MeiliSearch logo

MeiliSearch

От Rokmohar

Open-source поисковый движок для вашей витрины

Загрузка данных
GitHubnpm
Поиск
MeiliSearch logo

MeiliSearch

От Vymalo

Подключите быстрый поиск с MeiliSearch

Загрузка данных
GitHubnpm
Поиск
Relewise logo

Relewise

От Relewise

Прокачайте поиск по товарам с Relewise

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

Еще от этого автора

Посмотреть все
Платежи
S

Square plugin

От Weareseeed

Medusa Square Services Plugin.

Загрузка данных
npm
CMS
B

Builder

От Weareseeed

Easily connect your Medusa Js Commerce API to your Builder.io content!

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