Skip to content

VariableVic/medusa-ai-importer

Repository files navigation

Medusa logo

Medusa AI Importer

An AI Product Importer for the Medusa admin. You can paste in product data in any form: JSON, XML, csv, text, etc - and the LLM will turn in into Medusa products. Built with Medusa UI, OpenAI, and Vercel AI SDK.

Disclaimer: this code is the result of my experimentation, and is provided as-is. It's by no means optimized or actively maintained.

Follow @VariableVic

ai-importer.mp4

Prerequisites

  1. This widget requires an OpenAI platform account and API key. Go to https://platform.openai.com/account/api-keys to set this up.
  2. You need a valid Medusa database. The fastest way to set this up is by using create-medusa-app.

Getting Started

  1. Clone repo and install dependencies.
  2. In your .env file, add an OPENAI_API_KEY environment variable containing your API key, and link your database:
OPENAI_API_KEY=<YOUR OPENAI API KEY>
DATABASE_URL=<YOUR MEDUSA DB URL>
  1. Start your dev server and log into the admin. You'll find the importer on the settings page under 'extensions'!