Medusa Plugin Starter
Building blocks for digital commerce
Compatibility
This starter is compatible with versions >= 2.4.0 of @medusajs/medusa
.
Introduction
The Wishlist Plugin is a feature-rich extension for eCommerce platforms that allows customers to save products for future reference. This enhances the user experience by enabling shoppers to curate their favorite products and return later to complete their purchases.
Features
Add products to the wishlist with a single click.
Remove items from the wishlist easily.
Persistent wishlist across sessions.
User-specific wishlists (if authentication is enabled).
Lightweight and optimized for performance.
Responsive design for mobile and desktop compatibility.
Installation
npm install @tsc_tech/medusa-plugin-wishlist
OR
yarn add @tsc_tech/medusa-plugin-wishlist
Configuration
Step:1 Update Medusa Configuration Modify your medusa-config.ts to include the wishlist plugin:
module.exports = defineConfig({
plugins: [
{
resolve: "@tsc_tech/medusa-plugin-wishlist",
options: {},
},
],
})
Step:2 Run Migrations
npx medusa db:migrate
You can see the wishlist items added by a customer in the admin-dashboard
Log in to your admin panel.
Navigate to Customers.
In the customer detail page there is a section for wishlist items.
Postman APIs to test the plugin
- Register customer 'auth/customer/emailpass/register'
cURL Request
curl --location 'http://localhost:9000/auth/customer/emailpass/register' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "customer1@gmail.com",
"password": "supersecret"
}'
- Register customer in store 'store/customers' - pass the token that you got register customer into this api.
cURL Request
curl --location 'http://localhost:9000/store/customers' \
--header 'Content-Type: application/json' \
--header 'x-publishable-api-key: {{your-publishable-api-key}}' \
--header 'Authorization: Bearer {{your-bearer-token}}' \
--data-raw '{
"email": "customer1@gmail.com"
}'
- Login customer
cURL Request
curl --location 'http://localhost:9000/auth/customer/emailpass' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "customer1@gmail.com",
"password": "supersecret"
}'
- Post Wishlist from store - pass the token that you got from login customer into this api
cURL Request
curl --location 'http://localhost:9000/store/wishlist' \
--header 'x-publishable-api-key: {{your-publishable-api-key}}' \
--header 'Authorization: Bearer {{your-bearer-token}}' \
--header 'Content-Type: application/json' \
--data '{
"region_id": {{regionId}},
"variant_id": {{variantId}}
}'
- Get Wishlist (store) - pass the token that you got from login customer into this api
cURL Request
curl --location 'http://localhost:9000/store/wishlist?region_id={regionId}' \
--header 'Content-Type: application/json' \
--header 'x-publishable-api-key: {{your-publishable-api-key}}' \
--header 'Authorization: Bearer {{your-bearer-token}}' \
- Get wishlist in Admin - Bearer token will be the access token from admin login
cURL Request
curl --location 'http://localhost:9000/admin/wishlist' \
--header 'Authorization: Bearer {{your-bearer-token}}' \
- Get wishlist of a customer - Bearer token will be the access token from admin login
cURL Request
curl --location 'http://localhost:9000/admin/wishlist/customer/{customerId}' \
--header 'Authorization: Bearer {{your-bearer-token}}' \
- Check if wishlist has variant
cURL Request
curl --location 'localhost:9000/store/wishlist-has-variant?variant_id=variantId' \
--header 'x-publishable-api-key: {{your-publishable-api-key}}' \
--header 'Authorization: Bearer {{your-bearer-token}}' \
Community & Contributions
The community and core team are available in GitHub Discussions, where you can ask for support, discuss roadmap, and share ideas.