DEV Community

Rigby
Rigby

Posted on

Guide to Adding Custom Attributes in Medusa.js

Hello everyone, we want to share with you a plugin that our team recently built.

In our journey to create custom stores using Medusa.js, we encountered a challenge with adding custom attributes to the products.

Medusa.js lacked a built-in custom attribute API, so we used the metadata field with key-value pairs to store our attributes. However, filtering these attributes proved to be a complex task, as they could be of various types, such as arrays, strings, or numbers.

To address these limitations, we developed a new plugin - medusa-custom-attributes.

Plugin features:

Diverse Attribute Types: The plugin supports multi, single, range and boolean attributes, enabling a wide range of attribute customizations.
Effortless Ranking: Easily rank attribute values via a drag-and-drop interface in the admin panel.
Efficient Product Filtering: Filter your products with ease by using these custom attributes.
Category-Based Attributes: You can get attributes specific to particular categories, ensuring attribute relevance.

Links:
Github repo: https://github.com/vholik/medusa-custom-attributes
NPM: https://www.npmjs.com/package/medusa-custom-attributes

Read more about the plugin on our website ↓
Part 1 - How to add attributes in admin panel: https://rigby.pl/en/blog/custom-attributes-in-medusa.js
Part 2 - How to handle attributes on storefront: https://rigbyjs.com/blog/medusa

Leave your opinions about the plugin. Maybe you have ideas for further development of the plugin?

Top comments (0)