Badge Plugin
A Medusa v2 plugin that enables custom badge management for products.
Overview
This plugin allows you to add and manage custom badges for your products, helping highlight special features, promotions, or product attributes.
Requirements
- Medusa v2
- Node.js v20+
- Git CLI
- PostgreSQL
Installation
npm install medusa-badge-plugin
Configuration
Add the plugin to your medusa-config.ts:
module.exports = {
plugins: [
// ... other plugins
'medusa-badge-plugin',
],
}
Database Migration
Run the migration to create necessary tables:
npx medusa db:migrate
API Routes
The plugin adds API routes for badge management. You can test the functionality by importing the provided OpenAPI Spec file into Postman.
Testing
A Postman collection is included in the project documentation folder for API testing.
Links
- Medusa Documentation
- OpenAPI Spec file (included in documentation)
Use Cases
- Highlight new products with “New” badges
- Mark sale items with “Sale” or discount badges
- Show featured products
- Indicate limited stock items
- Display product certifications
- Highlight bestsellers
Features
- Custom badge creation
- Badge assignment to products
- API-based badge management
- Flexible badge styling support