Logo Medusa Admin

Medusa Admin

Tổ chức
OrcaQubits
medusa-admin

Extend the Medusa v2 admin dashboard — widgets injected at zones, custom UI routes, Medusa UI components, and Admin API integration. Use when customizing the admin interface.

Tổng quan

Nhà phát hànhOrcaQubits
Kho mãagentic-commerce-skills-plugins
Tên kỹ năngmedusa-admin
Sao
40
Bản fork
17
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Đầy đủ trong hướng dẫn

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được OrcaQubits công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Medusa Admin trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/OrcaQubits/agentic-commerce-skills-plugins/tree/main/medusa-commerce/skills/medusa-admin
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/OrcaQubits/agentic-commerce-skills-plugins.git /tmp/agentic-commerce-skills-plugins
mkdir -p .claude/skills
cp -r /tmp/agentic-commerce-skills-plugins/medusa-commerce/skills/medusa-admin .claude/skills/medusa-admin
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Medusa Admin trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Medusa Admin ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Medusa Admin không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Medusa v2 Admin Dashboard Extensions

Before writing code

Fetch live docs:

  1. Fetch https://docs.medusajs.com/learn/fundamentals/admin/widgets for widget development
  2. Web-search site:docs.medusajs.com admin UI routes for custom admin pages
  3. Web-search site:docs.medusajs.com admin widget injection zones for available zones
  4. Web-search site:docs.medusajs.com medusa UI components for component library
  5. Web-search site:docs.medusajs.com admin API client for making API calls from admin

Admin Extension Concept

Medusa v2 admin is a React-based SPA that supports two extension types:

  • Widgets -- injected into predefined zones on existing admin pages
  • UI Routes -- entirely new pages accessible via the admin sidebar or navigation

Extensions live in src/admin/ and are automatically discovered and bundled.

Admin Extension Directory Structure

DirectoryPurpose
src/admin/widgets/Widget components (e.g., product-custom-widget.tsx)
src/admin/routes/custom-page/page.tsxCustom admin page
src/admin/routes/custom-page/[id]/page.tsxDynamic route page
src/admin/lib/Shared API utilities

Widgets

Widget Injection Zones

ZoneLocationUse Case
product.details.beforeProduct detail, topCustom product fields
product.details.afterProduct detail, bottomRelated data display
product.details.side.beforeProduct detail sidebar, topQuick actions
product.details.side.afterProduct detail sidebar, bottomMetadata display
order.details.beforeOrder detail, topCustom order info
order.details.afterOrder detail, bottomFulfillment tracking
order.details.side.beforeOrder sidebar, topOrder tags
order.details.side.afterOrder sidebar, bottomOrder notes
customer.details.beforeCustomer detail, topLoyalty info
customer.details.afterCustomer detail, bottomPurchase history

Fetch live docs for the complete zone list -- zones are added with each Medusa release.

Widget Definition Skeleton

typescript
// src/admin/widgets/product-custom-widget.tsx
// Fetch live docs for defineWidgetConfig and zone types
import { defineWidgetConfig } from "@medusajs/admin-sdk"
import { Container, Heading } from "@medusajs/ui"

const ProductCustomWidget = ({ data }) => (
  <Container><Heading level="h2">Custom</Heading></Container>
)
typescript
export const config = defineWidgetConfig({ zone: "product.details.after" })
export default ProductCustomWidget

Widget Props

PropTypeDescription
dataEntity objectThe entity displayed on the page (product, order, etc.)

The data prop shape depends on the zone -- a product.details.* zone receives the product object.

Custom UI Routes

Route File Convention

File PathAdmin URL
src/admin/routes/custom-page/page.tsx/app/custom-page
src/admin/routes/custom-page/[id]/page.tsx/app/custom-page/:id
src/admin/routes/settings/my-setting/page.tsx/app/settings/my-setting

Route Page Skeleton

typescript
// src/admin/routes/custom-page/page.tsx
// Fetch live docs for defineRouteConfig
import { defineRouteConfig } from "@medusajs/admin-sdk"
import { Container, Heading } from "@medusajs/ui"

const CustomPage = () => (
  <Container><Heading level="h1">Custom Page</Heading></Container>
)
typescript
export const config = defineRouteConfig({ label: "Custom Page" })
export default CustomPage
// Fetch live docs for icon options in defineRouteConfig

Adding Sidebar Navigation

The defineRouteConfig with a label property automatically adds the page to the admin sidebar. Pages under routes/settings/ appear in the Settings section.

Medusa UI Component Library

CategoryKey Components
LayoutContainer, Drawer, FocusModal, Prompt
TypographyHeading, Text, Label, Code
FormsInput, Select, Checkbox, RadioGroup, Switch, Textarea, DatePicker
DataTable, Badge, StatusBadge, Avatar, Copy
ActionsButton, IconButton, DropdownMenu, CommandBar
FeedbackToast, Alert, ProgressBar, Spinner
NavigationTabs, Breadcrumbs

Fetch live docs: Web-search site:docs.medusajs.com @medusajs/ui components for the full component catalog and prop APIs.

Making Admin API Calls

Using the Medusa JS SDK

typescript
// Fetch live docs for admin SDK client setup
// Use the SDK or fetch wrapper provided by Medusa admin
// Fetch live docs for createAdminClient or useAdminXxx hooks
const { data } = await sdk.admin.product.list()

Using fetch with Admin Auth

Admin extensions run within the authenticated admin session. Use the built-in fetch wrapper or the JS SDK which automatically includes session credentials.

Admin API Scopes

ScopeEndpointsRequires
Store API (/store/*)Storefront operationsOptional customer auth
Admin API (/admin/*)Back-office operationsAdmin user session
Custom (/admin/custom/*)Custom admin endpointsAdmin auth middleware

Custom admin pages typically call /admin/* endpoints which require the admin session token.

Limitations

LimitationWorkaround
Cannot modify core admin pagesUse widgets injected at zones
Cannot override core admin routesCreate new routes with custom functionality
Limited styling controlUse @medusajs/ui components for consistency
No server-side renderingAdmin is a client-side SPA
Bundle sizeKeep widget dependencies minimal

Best Practices

  • Use @medusajs/ui components for visual consistency with the core admin
  • Keep widgets focused on a single concern -- use multiple widgets for multiple features
  • Use custom UI routes for complex multi-step interfaces
  • Call the Admin API through the JS SDK or built-in fetch wrapper -- do not hardcode URLs
  • Type your widget data prop for type safety
  • Place shared utilities in src/admin/lib/ for reuse across widgets and routes

Testing Admin Extensions

ApproachDescription
StorybookRender components in isolation with @medusajs/ui
Browser testingRun npx medusa develop and manually verify
Unit testsTest logic functions separately from React rendering

Fetch the Medusa admin extension documentation for exact injection zone names, component props, and route configuration options before implementing.

Câu hỏi thường gặp

Kỹ năng AI Medusa Admin làm được gì?

Extend the Medusa v2 admin dashboard — widgets injected at zones, custom UI routes, Medusa UI components, and Admin API integration. Use when customizing the admin interface.

Vì sao nên dùng Medusa Admin trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Medusa Admin là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Medusa Admin trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/OrcaQubits/agentic-commerce-skills-plugins/tree/main/medusa-commerce/skills/medusa-admin. TypingMind đọc tệp SKILL.md và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Medusa Admin?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Medusa Admin với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Medusa Admin với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Medusa Admin có miễn phí không?

Có. Kỹ năng này được OrcaQubits phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇