Admin dashboard plugin for Medusa e-commerce platform providing web interface for managing products, orders, customers, and store configuration.
—
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Pending
The risk profile of this skill
Complete TypeScript definitions for configuration options, UI extension components, and Medusa entity integrations.
Core configuration interfaces for plugin options and build settings.
/**
* Plugin configuration options extending AdminOptions
*/
interface PluginOptions extends AdminOptions {
/** Whether to serve the admin dashboard */
serve?: boolean;
/**
* Re-build admin automatically when options change since last server start
* Memory intensive process - use carefully in production
* Only used if serve is true
*/
autoRebuild?: boolean;
}
/**
* Build command configuration options
*/
interface BuildOptions extends AdminOptions {
/** Build for deployment to external host */
deployment?: boolean;
}
/**
* Base admin options interface from @medusajs/admin-ui
*/
interface AdminOptions {
/** Path to serve admin dashboard on (cannot be "admin" or "store") */
path?: string;
/** Output directory for build files */
outDir?: string;
/** Backend URL for API calls */
backend?: string;
/** Development server configuration */
develop?: DevelopmentOptions;
}
/**
* Development server configuration
*/
interface DevelopmentOptions {
/** Port for development server */
port?: number;
/** Host for development server */
host?: string;
/** Auto-open browser on start */
open?: boolean;
/** Allowed hosts configuration */
allowedHosts?: string;
/** WebSocket URL for hot reload */
webSocketURL?: string;
}Type definitions for creating custom admin UI extensions (re-exported from @medusajs/admin-ui).
/**
* Route configuration for custom admin pages
*/
interface RouteConfig {
// Re-exported from @medusajs/admin-ui
// Specific properties not available in source inspection
}
/**
* Props interface for route components
*/
interface RouteProps {
// Re-exported from @medusajs/admin-ui
// Specific properties not available in source inspection
}
/**
* Settings page configuration
*/
interface SettingConfig {
// Re-exported from @medusajs/admin-ui
// Specific properties not available in source inspection
}
/**
* Props interface for settings components
*/
interface SettingProps {
// Re-exported from @medusajs/admin-ui
// Specific properties not available in source inspection
}
/**
* Widget configuration for embedding in admin pages
*/
interface WidgetConfig {
// Re-exported from @medusajs/admin-ui
// Specific properties not available in source inspection
}
/**
* Base props interface for widget components
*/
interface WidgetProps {
// Re-exported from @medusajs/admin-ui
// Specific properties not available in source inspection
}Specialized widget props interfaces for different Medusa entities, extending the base WidgetProps.
/**
* Props for widgets on product detail pages
*/
interface ProductDetailsWidgetProps extends WidgetProps {
/** The product being viewed */
product: Product;
}
/**
* Props for widgets on product collection detail pages
*/
interface ProductCollectionDetailsWidgetProps extends WidgetProps {
/** The product collection being viewed */
productCollection: ProductCollection;
}
/**
* Props for widgets on order detail pages
*/
interface OrderDetailsWidgetProps extends WidgetProps {
/** The order being viewed */
order: Order;
}
/**
* Props for widgets on draft order detail pages
*/
interface DraftOrderDetailsWidgetProps extends WidgetProps {
/** The draft order being viewed */
draftOrder: DraftOrder;
}
/**
* Props for widgets on discount detail pages
*/
interface DiscountDetailsWidgetProps extends WidgetProps {
/** The discount being viewed */
discount: Discount;
}
/**
* Props for widgets on price list detail pages
*/
interface PriceListDetailsWidgetProps extends WidgetProps {
/** The price list being viewed */
priceList: PriceList;
}
/**
* Props for widgets on gift card detail pages (product-based)
*/
interface GiftCardDetailsWidgetProps extends WidgetProps {
/** The gift card product being viewed */
giftCard: Product;
}
/**
* Props for widgets on custom gift card pages
*/
interface CustomGiftCardWidgetProps extends WidgetProps {
/** The custom gift card being viewed */
giftCard: GiftCard;
}
/**
* Props for widgets on customer detail pages
*/
interface CustomerDetailsWidgetProps extends WidgetProps {
/** The customer being viewed */
customer: Customer;
}
/**
* Props for widgets on customer group detail pages
*/
interface CustomerGroupDetailsWidgetProps extends WidgetProps {
/** The customer group being viewed */
customerGroup: CustomerGroup;
}Core Medusa entity types used in widget props (imported from @medusajs/medusa).
/**
* Product entity from Medusa
* Imported from @medusajs/medusa
*/
interface Product {
// Complete Product interface definition available in @medusajs/medusa
id: string;
title: string;
// ... additional properties
}
/**
* Product collection entity from Medusa
* Imported from @medusajs/medusa
*/
interface ProductCollection {
// Complete ProductCollection interface definition available in @medusajs/medusa
id: string;
title: string;
// ... additional properties
}
/**
* Order entity from Medusa
* Imported from @medusajs/medusa
*/
interface Order {
// Complete Order interface definition available in @medusajs/medusa
id: string;
status: string;
// ... additional properties
}
/**
* Draft order entity from Medusa
* Imported from @medusajs/medusa
*/
interface DraftOrder {
// Complete DraftOrder interface definition available in @medusajs/medusa
id: string;
status: string;
// ... additional properties
}
/**
* Discount entity from Medusa
* Imported from @medusajs/medusa
*/
interface Discount {
// Complete Discount interface definition available in @medusajs/medusa
id: string;
code: string;
// ... additional properties
}
/**
* Price list entity from Medusa
* Imported from @medusajs/medusa
*/
interface PriceList {
// Complete PriceList interface definition available in @medusajs/medusa
id: string;
name: string;
// ... additional properties
}
/**
* Gift card entity from Medusa
* Imported from @medusajs/medusa
*/
interface GiftCard {
// Complete GiftCard interface definition available in @medusajs/medusa
id: string;
code: string;
// ... additional properties
}
/**
* Customer entity from Medusa
* Imported from @medusajs/medusa
*/
interface Customer {
// Complete Customer interface definition available in @medusajs/medusa
id: string;
email: string;
// ... additional properties
}
/**
* Customer group entity from Medusa
* Imported from @medusajs/medusa
*/
interface CustomerGroup {
// Complete CustomerGroup interface definition available in @medusajs/medusa
id: string;
name: string;
// ... additional properties
}import type { PluginOptions } from "@medusajs/admin";
const adminConfig: PluginOptions = {
serve: true,
path: "/admin",
autoRebuild: false,
outDir: "build",
backend: "/",
develop: {
port: 7001,
host: "localhost",
open: true,
allowedHosts: "auto"
}
};import type { ProductDetailsWidgetProps } from "@medusajs/admin";
const ProductAnalyticsWidget = ({ product }: ProductDetailsWidgetProps) => {
return (
<div>
<h3>Analytics for {product.title}</h3>
{/* Widget implementation */}
</div>
);
};
// Widget configuration
export const config = {
zone: "product.details.after"
};import type { RouteProps } from "@medusajs/admin";
const CustomReportsPage = (props: RouteProps) => {
return (
<div>
<h1>Custom Reports</h1>
{/* Route implementation */}
</div>
);
};
// Route configuration
export const config = {
label: "Custom Reports"
};All types are available from the main package:
import type {
PluginOptions,
BuildOptions,
RouteConfig,
RouteProps,
SettingConfig,
SettingProps,
WidgetConfig,
WidgetProps,
ProductDetailsWidgetProps,
OrderDetailsWidgetProps,
CustomerDetailsWidgetProps
// ... other widget prop types
} from "@medusajs/admin";serve: trueautoRebuild: falsepath: "/app"outDir: "build"backend: "/"port: 7001host: "localhost"open: trueallowedHosts: "auto"