
Learning Medusa
Extend a Medusa v2 storefront and admin with widgets, UI routes, and JS SDK calls against your commerce API.
Overview
Learning Medusa is an agent skill for the Build phase that teaches how to extend the Medusa Admin React app with widgets, UI routes, and JS SDK calls to your commerce backend.
Install
npx skills add https://github.com/medusajs/medusa-agent-skills --skill learning-medusaWhat is this skill?
- Maps admin dashboard architecture: React/Vite at /app, widgets vs UI routes
- Explains injection patterns for widgets and full-page UI routes
- Documents JS SDK HTTP flow from admin UI to Node backend API
- Covers backend API routes and workflows as the data layer for admin features
- Architecture deep-dive diagram for end-to-end feature extension
- Admin dashboard served at http://localhost:9000/app
- Two extension surfaces: widgets (inject) and UI routes (new pages)
Adoption & trust: 1.7k installs on skills.sh; 185 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You know Medusa ships an admin and API but not how widgets, routes, and workflows connect when you add a real operator feature.
Who is it for?
Indie builders adding custom Medusa admin screens or widgets after the core backend is running locally.
Skip if: Teams that only need generic React UI patterns with no Medusa commerce backend or JS SDK in scope.
When should I use this skill?
You are implementing or planning Medusa Admin extensions and need the widget, route, SDK, and API workflow architecture.
What do I get? / Deliverables
You get a clear admin–SDK–API architecture map so you can implement extensions without breaking how the dashboard talks to workflows and routes.
- Mental model and implementation plan for admin widgets or UI routes
- Aligned API route or workflow design for admin-backed features
Recommended Skills
Journey fit
Medusa work sits in Build when you wire the React admin, custom API routes, and workflows into a shippable commerce product. Integrations is the best shelf because the skill centers on admin↔backend coupling via the JS SDK and HTTP—not greenfield UI polish alone.
How it compares
Architecture orientation for Medusa admin extension—not a generic ecommerce theme or Stripe-style payment skill.
Common Questions / FAQ
Who is learning-medusa for?
Solo and indie developers building on Medusa who need to customize the operator dashboard and understand backend integration boundaries.
When should I use learning-medusa?
During Build when you add admin widgets or pages, debug SDK requests, or plan API routes and workflows that power commerce ops.
Is learning-medusa safe to install?
Review the Security Audits panel on this Prism page and inspect the skill source in medusa-agent-skills before granting agent filesystem or network access to your commerce repo.
SKILL.md
READMESKILL.md - Learning Medusa
# Architecture Deep Dive: Admin Dashboard Integration The Medusa Admin dashboard is a React application that connects to your backend API. Understanding how to extend it with widgets and UI routes is essential for building complete features. ## Admin Dashboard Architecture ``` ┌─────────────────────────────────────────────────┐ │ Admin Dashboard (React + Vite) │ │ Running at: http://localhost:9000/app │ │ │ │ ┌──────────────┐ ┌──────────────┐ │ │ │ Widgets │ │ UI Routes │ │ │ │ (Inject) │ │ (New Pages) │ │ │ └───────┬──────┘ └───────┬──────┘ │ │ │ │ │ │ └────────┬──────────┘ │ │ │ │ │ ▼ │ │ ┌──────────────┐ │ │ │ JS SDK │ │ │ └──────┬───────┘ │ └──────────────────┼─────────────────────────────┘ │ HTTP Requests ▼ ┌─────────────────────────────────────────────────┐ │ Backend API (Node.js) │ │ Running at: http://localhost:9000 │ │ │ │ ┌──────────────┐ ┌──────────────┐ │ │ │ API Routes │ │ Workflows │ │ │ └──────┬───────┘ └───────┬──────┘ │ │ │ │ │ │ └──────────┬─────────┘ │ │ ▼ │ │ ┌──────────────┐ │ │ │ Modules │ │ │ └──────────────┘ │ └─────────────────────────────────────────────────┘ ``` ## Widgets vs. UI Routes ### Widgets: Extend Existing Pages **What**: React components injected into existing admin pages at predefined zones **When to use**: - Adding information to existing pages - Displaying related data - Extending core entities (products, orders, customers) **Examples**: - Show brand on product detail page - Show reviews on product detail page - Show shipping status on order detail page ```typescript // Widget Example import { defineWidgetConfig } from "@medusajs/admin-sdk" const ProductBrandWidget = ({ data: product }) => { return <Container>Brand: {product.brand?.name}</Container> } export const config = defineWidgetConfig({ zone: "product.details.before", // Where to inject }) export default ProductBrandWidget ``` ### UI Routes: Create New Pages **What**: Completely new pages in the admin dashboard **When to use**: - Managing custom entities - Custom dashboards or reports - Standalone administrative interfaces **Examples**: - Brands management page - Reviews management page - Custom analytics dashboard ```typescript // UI Route Example import { defineRouteConfig } from "@medusajs/admin-sdk" const BrandsPage = () => { return ( <Container> <Heading>Brands</Heading> <DataTable data={brands} /> </Container> ) } export const config = defineRouteConfig({ label: "Brands", icon: TagSolid, }) export default BrandsPage ``` ## Key Differences | Aspect | Widgets | UI Routes | |--------|---------|-----------| | Purpose | Extend existing pages | Create new pages | | Location | Injected into zones | New URLs | | Navigation | No sidebar entry | Sidebar menu item | | File path | `src/admin/widgets/` | `src/admin/routes/` | | Configuration | `defineWidgetConfig()` | `defineRouteConfig()` | | Props | Receive page entity | No special props | ## Widget Integration Patterns ### Pattern 1: Display Widget (Read-Only) Show information from linked entities: ```typescript // Product Brand Widget - Display Only const ProductBrandWidget = ({ data: product }: DetailWidgetProps<AdminProduct>) => { const { data: queryRes