W
Wishlist
The plugin which provides wishlist functionality.
Medusa Wishlist
A wishlist plugin for Medusa v2 that allows customers to save products for later and share their wishlists with others.
Features
- ๐๏ธ Customer Wishlists - Each customer gets their own wishlist, automatically created when they add their first item
- โ Add/Update Items - Customers can add products to their wishlist and update quantities
- ๐๏ธ Remove Items - Easy removal of items from the wishlist
- ๐ Share Wishlists - Generate shareable links using JWT tokens
- ๐ Public Access - Shared wishlists can be viewed without authentication
- ๐ Secure - JWT-based token system for sharing
Installation
Option 1: Install as NPM Package
- Install the plugin:
- Add the plugin to your :
Or simply:
- Run database migrations:
npx medusa db:migrateOption 2: Copy Source Code
You can also copy the source code directly into your Medusa project:
- Copy the directory contents into your project
- Add the module to your :
- Install required dependencies:
- Run database migrations:
npx medusa db:migrateConfiguration
JWT Secret
The wishlist sharing feature uses JWT tokens. It's recommended to set a strong secret in your environment variables:
Then configure it in :
API Endpoints
Authenticated Endpoints (Require Customer Token)
Get Customer's Wishlist
Add or Update Item
Remove Item
Generate Share Token
Public Endpoints (No Authentication Required)
View Shared Wishlist
GET /store/wishlists?token={shared-token}Usage Example
1. Customer Login
2. Add Item to Wishlist
3. Get Wishlist
4. Generate Share Token
5. View Shared Wishlist (Public)
Database Schema
The plugin creates the following tables:
- - Primary key
- - Timestamp
- - Timestamp
- - Primary key
- - Foreign key to wishlist
- - Product identifier
- - Product variant identifier
- - Item quantity
- - Timestamp
- - Timestamp
- Links customers to their wishlists (1:1 relationship)
How It Works
- Automatic Creation: When a customer adds their first item, a wishlist is automatically created and linked to their account
- Item Management: Customers can add, update quantities, or remove items from their wishlist
- Sharing: Customers can generate a JWT token to share their wishlist with others
- Public Access: Anyone with the share token can view the wishlist without authentication
API Documentation
For detailed API specifications, see the OpenAPI documentation.
Development
Prerequisites
- Node.js 20+
- Medusa v2
- PostgreSQL
Local Setup
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see LICENSE file for details.
Credits
Created by RSC Labs
Support
For issues and questions:
- GitHub Issues: medusa-wishlist/issues
- Documentation: docs.medusajs.com
Built for Medusa v2 ๐

