Auto-Generate Product Variants in Medusa JS (No More Manual Combinations)
[Published On October 16, 2025]

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
Related Blogs

How to Connect Medusa JS to Supabase: Step-by-Step Guide
Connect Medusa.js to Supabase Postgres in just minutes, no Docker setup required. This step-by-step guide walks you through creating your Supabase project, linking it to Medusa, and exploring the database structure that powers your store.


Deploy Medusa JS to Railway: A Complete Step-by-Step Guide
Ready to launch your Medusa JS backend like a pro? This step-by-step guide shows you how to deploy on Railway with ease — fast, scalable, and production-ready.
