Medusa

Building a Medusa storefront with SvelteKit

Medusa covers catalogue, cart and checkout at 31 of 43 services. Here is the setup, plus two behaviours that surprise people.

Medusa's Store API is a clean REST surface and the connector reaches 31 of 43 services on it. Environment wiring ships in the repo, so setup is short — but two behaviours catch people out, and both are worth knowing before you deploy rather than after.

Setup

$ npm uninstall @misiki/litekart-connector
$ npm i @misiki/medusa-connector
// kitcommerce.config.ts
export * as services from './src/lib/core/connectors/medusa'
# .env
PUBLIC_MEDUSA_API_URL=http://localhost:9000
PUBLIC_MEDUSA_PUBLISHABLE_API_KEY=pk_...
PUBLIC_MEDUSA_REGION_ID=reg_...

All three matter. init.ts writes them onto the connector's BaseService statics as BASE_URL, PUBLISHABLE_KEY and REGION_ID. The region is not optional decoration — it drives pricing, currency and availability, so an unset region gives you a catalogue with no prices and a very confusing hour of debugging.

On the Medusa side: create a publishable API key in the admin, and add your storefront origin to the Store CORS config. The second one is the classic "works in dev, breaks on deploy" cause.

Surprise one: the search icon is missing

Not a bug. Autocomplete in this storefront is backed by Litekart's Meilisearch proxy, which does not exist in Medusa mode. Rather than ship a search box that returns nothing, plugins.search.active is false in the static store defaults, which hides the nav search trigger. Turn it on once you have wired a search backend.

Surprise two: which checkout paths complete

This is the one to read twice. Cart, shipping rates and payment-method listing are all Medusa-native and work. COD checkout completes via the SDK.

The online gateway methods — Razorpay, Stripe, PhonePe, PayPal, Cashfree, Affirm — still post to Litekart /api/checkout/* endpoints in this connector, and will not work without a Litekart API behind them. If you are running Medusa and need card payments, that is the integration you will be writing.

Saying that plainly is more useful than a checkmark in a feature table. The alternative is you discover it during launch week.

Login behaviour

Email login, signup, logout and password reset are native through the Medusa SDK. getOtp is a mock — it reports success without sending anything — so the auth modal ships with loginType: "EMAIL" in the static defaults.

Full guide: docs/MEDUSA.md.

Try it against your own backend.