@misiki/medusa-connector
v2.1.7
Published
API Connector for Medusa with Svelte Commerce
Readme
@misiki/medusa-connector
The Official TypeScript API Connector for connecting svelte-commerce to Medusa E-Commerce Backend.
@misiki/medusa-connector provides a production-ready, fully-typed API client and integration layer that seamlessly bridges svelte-commerce storefronts with Medusa headless e-commerce backends — part of the Litekart connector suite, mirroring the full 43-service surface of @misiki/litekart-connector.
Coverage: 34 of 43 services are wired to the live Medusa API. The remaining 9 have no Medusa equivalent and return empty placeholder data — except
client.auth, which throwsNotSupportedErrorrather than fabricating a session. Each placeholder says why in a comment at the top of its service file.
🚀 Step-by-Step Integration Guide
Follow these steps to connect svelte-commerce with medusa-connector and your Medusa backend.
1. Install the Connector
Inside your svelte-commerce project directory, run:
bun i @misiki/medusa-connector(Or using npm / pnpm / yarn):
npm install @misiki/medusa-connector
# or
pnpm add @misiki/medusa-connector2. Configure kitcommerce.config.ts
In svelte-commerce, open kitcommerce.config.ts and change the export * line to import from @misiki/medusa-connector:
// kitcommerce.config.ts
export * from '@misiki/medusa-connector';3. Environment Variables Setup
Add the required environment variables in your svelte-commerce .env file:
PUBLIC_MEDUSA_API_URL=http://localhost:9000
PUBLIC_MEDUSA_PUBLISHABLE_API_KEY=pk_01...
PUBLIC_MEDUSA_REGION_ID=reg_01...4. Obtaining Environment Settings & Configuring Medusa Admin
To get the necessary API configurations and properly configure your Medusa backend:
- Log into Medusa Admin:
- Access your Medusa Admin dashboard (e.g.
http://localhost:9000/appor your deployed Medusa Admin).
- Access your Medusa Admin dashboard (e.g.
- Verify & Copy Medusa API Endpoint:
- Obtain your Medusa API endpoint URL (e.g.
http://localhost:9000). - Set this URL as the value for
PUBLIC_MEDUSA_API_URLin your.envfile.
- Obtain your Medusa API endpoint URL (e.g.
- Obtain Publishable API Key:
- In Medusa Admin, navigate to Settings > Publishable API Keys.
- Create or select a key, ensure your sales channel is attached, and set the value for
PUBLIC_MEDUSA_PUBLISHABLE_API_KEYin your.envfile.
- Obtain Region ID:
- In Medusa Admin, navigate to Settings > Regions to copy your preferred Region ID.
- Set this ID as the value for
PUBLIC_MEDUSA_REGION_IDin your.envfile.
5. Build and Run the Project
Run the development server in svelte-commerce:
bun devTo build and run the production application:
# Build the project
bun run build
# Preview the built application
bun run previewService coverage
| Service | Status |
| --- | --- |
| client.product | ⚠️ placeholder (no Medusa equivalent) |
| client.category | ⚠️ placeholder (no Medusa equivalent) |
| client.collection | ✅ live |
| client.order | ✅ live |
| client.coupon | ✅ live |
| client.address | ⚠️ placeholder (no Medusa equivalent) |
| client.review | ✅ live |
| client.cart | ⚠️ placeholder (no Medusa equivalent) |
| client.country | ✅ live |
| client.state | ✅ live |
| client.currency | ✅ live |
| client.region | ✅ live |
| client.page | ✅ live |
| client.blog | ✅ live |
| client.settings | ✅ live |
| client.store | ✅ live |
| client.paymentMethod | ⚠️ placeholder (no Medusa equivalent) |
| client.search | ⚠️ placeholder (no Medusa equivalent) |
| client.autocomplete | ✅ live |
| client.user | ⚠️ placeholder (no Medusa equivalent) |
| client.auth | ⛔ throws NotSupportedError |
| client.profile | ✅ live |
| client.wishlist | ✅ live |
| client.vendor | ✅ live |
| client.checkout | ✅ live |
| client.upload | ✅ live |
| client.banner | ✅ live |
| client.chat | ✅ live |
| client.contact | ✅ live |
| client.deal | ✅ live |
| client.demoRequest | ✅ live |
| client.enquiry | ✅ live |
| client.faq | ✅ live |
| client.feedback | ✅ live |
| client.gallery | ✅ live |
| client.home | ✅ live |
| client.init | ✅ live |
| client.meilisearch | ✅ live |
| client.menu | ✅ live |
| client.plugins | ✅ live |
| client.popularSearch | ✅ live |
| client.popularity | ⚠️ placeholder (no Medusa equivalent) |
| client.reels | ✅ live |
Development
bun install && bun run buildLicense
MIT © misiki-in
