Medusa v1.7.3: Sales Channels out of Beta, Improvements to events, and more!
Tags: webdev, javascript, opensource, programming
Published: 2023-01-12 12:23:09

Time for another exciting release of Medusa!

Version 1.7.3 moves Sales Channels and Publishable API Keys out of beta, introduces improvements for events system and payment sessions, and more.

Keep reading below to learn more about all the new changes in this release of Medusa!

## How to Update Medusa?

### Medusa Server

You can update your Medusa server using the following command:

```bash
npm install @medusajs/medusa@latest @medusajs/medusa-cli@latest medusa-interfaces@latest
```

Then, please follow [the upgrade guide](https://docs.medusajs.com/advanced/backend/upgrade-guides/1-7-3) for additional required steps.

### Medusa Admin

You can also update the Medusa Admin by pulling changes from the [GitHub repository](https://github.com/medusajs/admin).

## Sales Channels

We first introduced Sales Channels in v1.3.5 of Medusa. However, as this feature was in beta mode, it was guarded by feature flags. As of v1.7.3, it is enabled by default.

If you’re not familiar with what sales channels are, they allow merchants to create separate channels they sell their products in. Then, they can specify which sales channels are available in that sales channel.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/on1ew2f7m8to9axwp4kc.jpg)

Subsequently, this would lead to showing customers only products available in their sales channels.

For example, in a B2B use case, a merchant can create a B2B sales channel with products only available for B2B customers. Other types of customers wouldn’t be able to purchase these products.

Learn more about Sales Channels in [this documentation](https://docs.medusajs.com/advanced/backend/sales-channels/).

## Publishable API Keys

Publishable API Keys are used to associate resources with an API key. Then, when that publishable API key is used on the client-side, retrieving or processing data is only performed on the defined scope of resources for this API key.

This can be useful when you have resources that you have to pass as parameters for every or most requests.

An example of this is using sales channels on the storefront. You would need to pass the ID of the sales channel to the list products and the create cart requests, among others. This approach is error-prone and can be a hassle during development.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/38d1t93k41d1ukb9bkpa.jpg)

With Publishable API keys, you can just pass the API key in the header of the request. When using tools like Medusa JS Client or Medusa React, you only need to pass the API key once, and it’ll automatically be added to all requests.

At the moment, publishable API keys can only be associated with sales channels.

Learn more about Publishable API Keys in [this documentation](https://docs.medusajs.com/advanced/backend/publishable-api-keys/).

## Improvements in the Events System

Medusa’s events system allows you to subscribe a handler method to certain events. The handler method would perform asynchronous action when the event is triggered.

For example, you can subscribe to the `order.placed` event so that when it’s triggered, you send the customer an email.

In v1.7.3, we introduce improvements into the events system, the main being the ability to retry failed handler methods. Errors can commonly occur in handler methods, either due to errors in the logic of the method or due to errors with third-party services.

You can now specify a unique ID of a subscribed event handler and specify how many times it should be retried in case it fails. Improvements also include enhanced readability and allowing for horizontal scaling.

Learn more about the events architecture in [this documentation](https://docs.medusajs.com/advanced/backend/events/architecture).

## New Payment Session Flow

In v1.7.3, we refactored our payment session flow to improve its performance. The new change reduces the amount of times Medusa communicated with the third-party payment providers.

This improvement does not require any changes in how you use and implement the checkout flow or any payment-related flow.

## Redesigned Admin Sidebar

The admin sidebar is now redesigned for a clearer design. The team and users section is now removed, and the sidebar is only focused on important links such as Orders and Products.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5xngrh94faro5spgiczt.png)

In upcoming versions, we’ll introduce additional redesign changes such as collapsible sidebar, history, improved help center, and more.

## Documentation Changes

In our documentation we’ve implemented general fixes and added new documentation pages such as:

*   Storefront guide on [how to implement customer profiles](https://docs.medusajs.com/advanced/storefront/customer-profiles).
*   Gift cards [conceptual guide](https://docs.medusajs.com/advanced/backend/gift-cards/) along with how-to guides for [storefronts](https://docs.medusajs.com/advanced/storefront/use-gift-cards) and [admins](https://docs.medusajs.com/advanced/admin/manage-gift-cards).
*   [Claim-order flow](https://docs.medusajs.com/advanced/storefront/implement-claim-order) documentation.
*   Development guide on [how to customize Medusa Admin](https://docs.medusajs.com/admin/development).

## Did you miss out on?

*   [Implementing 5 features in Nike’s Ecommerce Store with Medusa](https://medusajs.com/blog/implementing-5-features-in-nike-ecommerce-store-with-medusa/)
*   [How we improved our documentation](https://medusajs.com/blog/how-we-improved-our-documentation/)
*   [Top 10 Medusa Blog Posts of 2022](https://medusajs.com/blog/top-10-medusa-blog-posts-2022/)
*   [Next.js Storefront: Building a Food Ecommerce Restaurant with Medusa and Paystack](https://medusajs.com/blog/next-js-storefront-food-ecommerce-restaurant-medusa-paystack/)
*   [10+ Live Chat Widgets for Ecommerce Stores in 2023](https://medusajs.com/blog/13-live-chat-widgets-for-ecommerce-stores-in-2023/)

> Should you have any issues or questions related to Medusa, then feel free to reach out to the Medusa team via [Discord](https://discord.gg/F87eGuwkTp).