@misiki/swell-connector
v0.4.1
Published
API Connector for Swell with Svelte Commerce
Readme
@misiki/swell-connector
The Official TypeScript API Connector for connecting svelte-commerce to Swell E-Commerce Backend.
@misiki/swell-connector provides a production-ready, fully-typed API client and integration layer that seamlessly bridges svelte-commerce storefronts with Swell headless e-commerce backends — part of the Litekart connector suite, mirroring the full 43-service surface of @misiki/litekart-connector.
Coverage: 23 of 43 services are wired to the live Swell API. The remaining 20 have no Swell equivalent and return empty placeholder data. 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 swell-connector and your Swell backend.
1. Install the Connector
Inside your svelte-commerce project directory, run:
bun i @misiki/swell-connector(Or using npm / pnpm / yarn):
npm install @misiki/swell-connector
# or
pnpm add @misiki/swell-connector2. Configure kitcommerce.config.ts
In svelte-commerce, open kitcommerce.config.ts and change the export * line to import from @misiki/swell-connector:
// kitcommerce.config.ts
export * from '@misiki/swell-connector';3. Configure Credentials
Pass apiUrl (https://{store}.swell.store/api), apiKey (store id), apiSecret (secret key) — sent as Basic auth.
API docs: https://developers.swell.is/backend-api
import { SwellConnector } from '@misiki/swell-connector'
// Credentials are set once, statically — the constructor only takes an optional fetch.
SwellConnector.setCredentials({
apiUrl: 'https://store.swell.store/api',
apiKey: 'store_id',
apiSecret: 'secret_key'
})
const client = new SwellConnector()
const products = await client.product.list({ page: 1, sort: '-createdAt' })4. 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 | ✅ live |
| client.category | ✅ live |
| client.collection | ⚠️ placeholder (no Swell equivalent) |
| client.order | ✅ live |
| client.coupon | ✅ live |
| client.address | ✅ live |
| client.review | ⚠️ placeholder (no Swell equivalent) |
| client.cart | ✅ live |
| client.country | ✅ live |
| client.state | ⚠️ placeholder (no Swell equivalent) |
| client.currency | ✅ live |
| client.region | ✅ live |
| client.page | ✅ live |
| client.blog | ✅ live |
| client.settings | ✅ live |
| client.store | ✅ live |
| client.paymentMethod | ✅ live |
| client.search | ✅ live |
| client.autocomplete | ✅ live |
| client.user | ✅ live |
| client.auth | ✅ live |
| client.profile | ✅ live |
| client.wishlist | ⚠️ placeholder (no Swell equivalent) |
| client.vendor | ⚠️ placeholder (no Swell equivalent) |
| client.checkout | ✅ live |
| client.upload | ⚠️ placeholder (no Swell equivalent) |
| client.banner | ⚠️ placeholder (no Swell equivalent) |
| client.chat | ⚠️ placeholder (no Swell equivalent) |
| client.contact | ⚠️ placeholder (no Swell equivalent) |
| client.deal | ⚠️ placeholder (no Swell equivalent) |
| client.demoRequest | ⚠️ placeholder (no Swell equivalent) |
| client.enquiry | ⚠️ placeholder (no Swell equivalent) |
| client.faq | ⚠️ placeholder (no Swell equivalent) |
| client.feedback | ⚠️ placeholder (no Swell equivalent) |
| client.gallery | ⚠️ placeholder (no Swell equivalent) |
| client.home | ⚠️ placeholder (no Swell equivalent) |
| client.init | ✅ live |
| client.meilisearch | ✅ live |
| client.menu | ✅ live |
| client.plugins | ⚠️ placeholder (no Swell equivalent) |
| client.popularSearch | ⚠️ placeholder (no Swell equivalent) |
| client.popularity | ⚠️ placeholder (no Swell equivalent) |
| client.reels | ⚠️ placeholder (no Swell equivalent) |
Development
bun install && bun run typecheck && bun run buildLicense
MIT © misiki-in
