Blog/Auto-Generate Product Variants in Medusa JS (No More Manual Combinations)

Auto-Generate Product Variants in Medusa JS (No More Manual Combinations)

[Published On October 16, 2025]

Medusa JS product variants auto generate
Share

We’ve all been there, you’ve got a few new SKUs for a product (size: medium, large; color: red, yellow), and you start adding them through the Medusa dashboard. Then it hits you, you have to create every single variant manually. (medium/red, large/yellow… you get the idea.)


Thankfully, we built a Medusa JS plugin that turns this from a tedious hour-long task into something you can do in just a few seconds.

Here’s how it works

Installation

Run this installation command in your project

1npm i @306technologies/auto-gen-variants

Configuration

Add the plugin to your Medusa config file (medusa.config.ts):

1import { defineConfig } from "@medusajs/medusa" 2 3export default defineConfig({ 4 // ...other settings 5 plugins: [ 6 { 7 resolve: "@306technologies/auto-gen-variants", 8 options: {}, // no options required 9 }, 10 ], 11}) 12

Run development server

1Run development server

And that’s it. You are ready to rock and roll!

How It Works (At a Glance)

Here’s the magic behind the plugin, it's really simple and straightforward.

The plugin automatically detects all option combinations (for example, Size × Color × Material) from your existing product setup.


It then calculates the cartesian product of those options, generating every potential variant combination while filtering out the ones that already exist.


Through the custom product widget, you can simply click and choose the variants you want to, along with their details, SKUs, and pricing.

NPM Package

https://www.npmjs.com/package/@306technologies/auto-gen-variants

Github Repository

https://github.com/rajmahil/auto-gen-variants

Custom Medusa js deployment services

Your Go-To Medusa JS Development Team!

We partner with ambitious teams to build, launch, and scale with Medusa JS.

Fri, Oct 17, 2025, 03:32 AM

© 2025 306 Technologies Ltd. All Rights Reserved.

[Technology Partners]
Shopify Partner | 306 TechnologiesVercel Partner | 306 TechnologiesBooqable Partner | 306 Technologies