@vymalo/medusa-wishlist
v0.0.2
Published
A starter for Medusa projects.
Maintainers
Readme
Medusa v2 Example: Wishlist Plugin
This directory holds the code for the Wishlist Plugin Guide.
You can either:
- install and use it as a plugin in the Medusa application;
- or copy its source files into an existing Medusa application, without using them as a plugin.
Prerequisites
Installation
- In your Medusa application, run the following command to install the wishlist plugin:
yarn add @vymalo/medusa-wishlist # or npm install @vymalo/medusa-wishlist- Add the plugin to the
pluginsarray inmedusa-config.ts:
module.exports = defineConfig({
// ...
plugins: [
{
resolve: "@vymalo/medusa-wishlist",
options: {}
}
]
})- Add the following
adminconfiguration inmedusa-config.ts:
module.exports = defineConfig({
// ...
admin: {
vite: () => {
return {
optimizeDeps: {
include: ["qs"],
},
};
},
},
})
- Run the
db:migratecommand to run migrations and sync links:
npx medusa db:migrateCopy into Existing Medusa Application
You can also copy the source files into an existing Medusa application, which will add them not as a plugin, but as standard Medusa customizations.
- Copy the content of the following directories:
src/api/storeandsrc/api/middlewares.tssrc/linksrc/modules/wishlistsrc/workflows
- Add the Wishlist Module to
medusa-config.ts:
module.exports = defineConfig({
// ...
modules: [
{
resolve: "./src/modules/wishlist"
},
]
})- Run the
db:migratecommand to run migrations and sync links:
npx medusa db:migrateTest it Out
To test out that the plugin is working, you can go to any product page on the Medusa Admin and see a Wishlist section at the top of the page. You can also try importing the OpenAPI Spec file and using the API routes added by this plugin.
More Resources
- Medusa Documentatin
- OpenAPI Spec file: Can be imported into tools like Postman to view and send requests to this project's API routes.
