First look at medusa-extender

I'm a full-stack developer from South Africa 🇿🇦. I love writing about JavaScript, HTML and CSS.
Search for a command to run...

I'm a full-stack developer from South Africa 🇿🇦. I love writing about JavaScript, HTML and CSS.
No comments yet. Be the first to comment.
Most of you know me for my consistency, a golden arrow in my blog series. I've written 1000 articles in 1008 days! Almost an article a day, and my honeymoon was the only holiday I ever took. I'm super proud of this achievement; it has been a fantasti...

It's not the first time I'll be talking about community. I think it's an essential aspect of any successful tool. This shows in my previous explorations of Astro, Medusa, and now Vendure as well. All these products thrive in a super open, welcoming, ...

The cool part about Vendure is how easy it is to set up and how abstract each layer is. Basically, we get the following elements: External database Server Worker Admin UI Frontend While this is amazing, it also brings a bit of complexity when it co...

The previous article looked at customizing Vendure on a data and process level. In this article, we'll look at customizing emails, as they are often a big part of a webshop system. We'll be looking at two different layers of customization for customi...

Even though Vendure is a pretty significant project out of the box, in some cases, we might want to go in and modify some elements to work to our specific use case. In this article, I'll take a high-level look at some elements we can customize within...

As we have seen in the previous articles, medusa offers many fantastic customizable options. However, sometimes we might even want to go beyond that, and that's precisely where medusa-extender comes in.
We can use medusa-extender to extend things out of the box more efficiently as it handles most of the logic.
In this article, we'll look at installing it and how to enable it in our project.
If you are following along, please ensure you have the medusa server setup.
From there, open your terminal, navigate to the project root, and run the following command.
npm i medusa-extender
From there, we can run the init function, which does all the heavy lifting.
./node_modules/.bin/medex init
This command will ensure all our packages are there. We are running the project in TypeScript mode and changing our package commands.
You'll also note a new modules folder is created in your src directory.
This contains some examples of a module/router and service.
By inspecting these files, we quickly learn that there are many cool things we can use out of the box.
For example, the router has a requiredAuth function built in.
We can quickly spool up our server in dev mode: npm start and check out this new route. (localhost:9000/admin/custom-route)
You can try and change the auth required to see the change from it being required, yes or no.
Let's look at all the things medusa-extender can help us with.
In the coming articles, we'll look closely at some of these and how they will work.
Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on Facebook or Twitter