This week we released a new version of Medusa!
Version
brings new features and enhancements including BatchJob API, Import API, Feature Flags, and more!Copy to clipboard1.3.3
Along with this new release, we have released a new version of the Medusa Admin, released an advanced Next.js Starter, and further updated and enhanced our documentation.
Keep reading below to learn more about the new features and what upcoming features you can expect from Medusa.
Features
BatchJob API
The addition of the BatchJob API opens the door for new features in this release and future releases.
The purpose of this API is to allow users to upload and export batches of data in Medusa asynchronously. For example, users can export products as CSV files or import products from CSV files.
This feature includes the addition of the necessary services and interfaces to allow a seamless experience while handling batch jobs in your Medusa server.
Depending on the batch job’s type, a strategy is implemented to handle the job. For example, when the user requests to export products, the
is used to handle it.Copy to clipboardProductExportStrategy
These strategies are also extendable and customizable. Developers can override it by creating a file in the Medusa server under
that extends theCopy to clipboardsrc/strategies
abstract class.Copy to clipboardAbstractBatchJobStrategy
A BatchJob can be created by sending a
request toCopy to clipboardpost
and setting theCopy to clipboard/admin/batch-jobs
in the body of the request. The strategy associated with theCopy to clipboardtype
will be used.Copy to clipboardtype
Import/Export API
Following the implementation of the BatchJob API, the Import/Export API was possible to implement within Medusa. This API would implement the strategies needed to import or export different domains within Medusa.
In this release, two strategies were implemented that allow exporting products and orders. Future releases would allow the import of products, as well as the import and export of different domains within Medusa.
Product Export
Using the new Import/Export API, you can export products into a CSV file. This is done by sending a
request toCopy to clipboardPOST
and in the body of the request setCopy to clipboard/admin/batch-jobs
toCopy to clipboardtype
.Copy to clipboardproduct-export
You can also filter the products you want to export instead of exporting all products. This is an example of a request for a product export with filters:
Order Export
Similarly, you can export orders on your Medusa server into a CSV file. You can do that by sending a
request toCopy to clipboardPOST
and in the body of the request setCopy to clipboard/admin/batch-jobs
toCopy to clipboardtype
.Copy to clipboardorder-export
You can also filter the orders you want to export instead of exporting all orders. This is an example of a request for an order export with filters:
Feature Flags
Feature flags are used to disable features that are still under development and testing. This will help us increase the frequency of releases of Medusa’s core as we’ll be able to disable any features that are still not ready for use in a production environment.
Feature flags are files created under
. Each feature flag has a key, the name of an environment variable that controls whether the feature is turned on or not, a default value, and a description. For example:Copy to clipboardsrc/loaders/feature-flags/*.ts
Features can be enabled or disabled either by setting the environment variable associated with the feature or setting the flag in the
file underCopy to clipboardmedusa-config.js
. By default, it will have the value defined in the feature flag file.Copy to clipboardconfigMudle.featureFlags.<feature_key>
To use feature flags, we’ve added helper classes, decorators, and middleware to check whether a feature is enabled or not.
For example, to enable an API endpoint only if a feature is enabled you can use the
middleware:Copy to clipboardfeatureFlagEnabled
Another example is using the
in a service to determine whether a feature is enabled or not:Copy to clipboardFlagRouter
Feature flags can be used throughout the Medusa server including migrations and models.
Other
In the GitHub repository, we’ve moved from using Lerna to Turborepo as Lerna is no longer actively maintained. This move will improve build and test time locally and in the CI pipeline of the repository.
Additionally, we’ve removed the
andCopy to clipboardmongoose
dependencies from the coreCopy to clipboardmongodb
package as they are no longer in use.Copy to clipboardmedusa
How to Update Your Medusa Server?
To update your Medusa server, first, update the Medusa packages in your dependencies:
Then, run migrations with Medusa’s CLI tool:
Medusa Admin New Features
Product/Order Export
Following the addition of the Import/Export API, you can now export products and orders from your Medusa Admin.
You can create a new export by clicking the “Export Products” button on the Products page, or the “Export Orders” button on the Orders page. This creates a new export batch job to export your products or orders into CSV files.
In upcoming releases, we’ll add the UI to filter the products and orders to export.
Activity Drawer
Clicking the notification bell icon in the top right of the navigation bar now opens an Activity Drawer. This Activity Drawer will contain important notifications for the admin user.
In this release, only the list of batch jobs will be available in the Activity Drawer where users can track the status of export jobs they started or download finished batch jobs.
The Activity Drawer uses a new
that listens to everything related to batch jobs including their creation, updates in their status, and more.Copy to clipboardPollingContext
How to Update Medusa Admin
You can update your Medusa admin by pulling new changes from the Medusa Admin repository into your Medusa Admin.
New Next.js Storefront
We previously had a starter Next.js storefront with limited functionalities to help developers interested in using Next.js for their storefront get a head start.
This week, we’ve released a new Next.js storefront with advanced features and a sleek, modern design. The new Next.js storefront includes features that were previously implemented including product listing and a checkout flow.
Additionally, this storefront includes full implementation of customer profile, support for payment Stripe and PayPal payment providers, and support for search with either MeiliSearch or Algolia.
Documentation
Since the last release, we’ve improved our documentation to include more helpful guides to assist you while developing with Medusa including:
- A new CLI reference that you can refer to when using Medusa’s CLI tool.
- Added a “Configure your Server” documentation with a full list of available configurations you can use when configuring your Medusa server.
- Improved and updated deployment guides including deploying the server to Heroku, Admin to Netlify, and Gatsby to Netlify. We’ve also added a new “Deploy to Heroku” button that you can use to instantly deploy a Medusa server on Heroku.
- Added documentation for the PayPal plugin with details related to the server, admin, and storefront setup.
- Added new documentation to learn how to implement the checkout flow in your storefront.
Upcoming Features
Sales Channels API
In the
release newsletter, we mentioned that we are planning the Sales Channel API feature. In this quarter, we kickstart the development of the Sales Channels API.Copy to clipboard1.3.1
Sales Channels will allow merchants to sell across multiple channels such as mobile apps or the Amazon marketplace. This will additionally make it possible to differentiate between the channels and ultimately provide rules and conditions specific to each channel.
Product Import
After implementing the export feature for this release, we’ll work on the import feature. This will allow users to import products stored in CSV files into their Medusa server. With both Import and Export functionalities available, migrating data from one Medusa server to another will be much easier.
Did you miss out on?
- Marketplace Tutorial Part 3: Implement User Management and Permissions
- Creating a React Native Ecommerce app with Medusa
- Case study: How Tekla improved conversion by 70% at record speed using Medusa
- Building with Nuxt.js for a Vue Ecommerce Platform Part 3: Ecommerce Checkout Flow with Stripe
Should you have any issues or questions related to Medusa, then feel free to reach out to the Medusa team via Discord.
Share this post
Try Medusa
Spin up your environment in a few minutes.

You may also like
On this page