0.0.5 • Published 6 months ago

@devx-commerce/banners v0.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

@devx-commerce/banners by devx commerce

Medusa Banner Plugin

A plugin for Medusa e-commerce platforms that enables management of banners throughout the storefront.

Overview

The Banner Plugin allows store administrators to create and manage different types of banners across the storefront. Banners can be customized with titles, descriptions, CTAs, links, media, and styling options.

Features

  • Create and manage various banner types:
    • Hero section banners
    • Menu banners
    • Mini banners
  • Assign banners to different sections of the website
  • Customize banner content:
    • Title and subtitle
    • Description
    • Call-to-action button and link
    • Background and text colors
    • Media (separate options for web and mobile)
  • Set banner status (draft/published)
  • Integrate with Medusa Admin UI
  • REST API endpoints for both admin and store

Requirements

  • Medusa Server (v2.4.0 or higher)
  • Node.js (v20 or higher)
  • PostgreSQL

Installation

# Using npm
npm install @devx-commerce/banners

# Using yarn
yarn add @devx-commerce/banners

Configuration

Add the plugin to your medusa-config.js file:

const plugins = [
  // ... other plugins
  {
    resolve: "@devx-commerce/banners",
    options: {},
  },
];

Banner Properties

Each banner has the following properties:

  • id: Unique identifier (prefixed with "ban")
  • title: Main banner heading
  • subtitle: Secondary banner text
  • link: URL for banner redirection
  • ctaTitle: Call-to-action button text
  • description: Detailed banner text
  • bannerVariant: Type of banner (HERO_SECTION_BANNER, MENU_BANNER, MINI_BANNER)
  • module: Section of website (HOME, CONTACT, ABOUT, STORE, REVIEWS)
  • section: Custom section identifier
  • websiteMedia: Media URL for desktop display
  • mobileMedia: Media URL for mobile display
  • bgColor: Background color
  • textColor: Text color
  • status: Current banner status (DRAFT, PUBLISHED)

API Endpoints

Admin Endpoints

  • GET /admin/banners: List all banners (with filtering and pagination)
  • POST /admin/banners: Create a new banner
  • GET /admin/banners/:id: Get a specific banner
  • PUT /admin/banners/:id: Update a banner
  • DELETE /admin/banners/:id: Delete a banner

Store Endpoints

  • GET /store/banners: Get published banners for display in the storefront

Development

# Start development server
yarn dev

# Build the plugin
yarn build

License

MIT


Made with Medusa

0.0.5

6 months ago

0.0.2-beta.6

6 months ago

0.0.2-beta.5

6 months ago

0.0.4

7 months ago

0.0.2-beta.4

8 months ago

0.0.3

8 months ago

0.0.2-beta.3

8 months ago

0.0.2-beta.2

8 months ago

0.0.2

8 months ago

0.0.2-beta.1

8 months ago

0.0.1

8 months ago