@misiki/sharetribe-connector

v0.4.1

Published

API Connector for Sharetribe with Svelte Commerce

Readme

@misiki/sharetribe-connector

NPM Version License TypeScript

The Official TypeScript API Connector for connecting svelte-commerce to Sharetribe E-Commerce Backend.

@misiki/sharetribe-connector provides a production-ready, fully-typed API client and integration layer that seamlessly bridges svelte-commerce storefronts with Sharetribe headless e-commerce backends — part of the Litekart connector suite, mirroring the full 43-service surface of @misiki/litekart-connector.

Coverage: 21 of 43 services are wired to the live Sharetribe API. The remaining 22 have no Sharetribe 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 sharetribe-connector and your Sharetribe backend.

1. Install the Connector

Inside your svelte-commerce project directory, run:

bun i @misiki/sharetribe-connector

(Or using npm / pnpm / yarn):

npm install @misiki/sharetribe-connector
# or
pnpm add @misiki/sharetribe-connector

2. Configure kitcommerce.config.ts

In svelte-commerce, open kitcommerce.config.ts and change the export * line to import from @misiki/sharetribe-connector:

// kitcommerce.config.ts
export * from '@misiki/sharetribe-connector';

3. Configure Credentials

Pass apiUrl (https://flex-api.sharetribe.com), accessToken (OAuth2 token). Marketplace API — listings/transactions/users.. API docs: https://www.sharetribe.com/api-reference/marketplace.html

import { SharetribeConnector } from '@misiki/sharetribe-connector'

// Credentials are set once, statically — the constructor only takes an optional fetch.
SharetribeConnector.setCredentials({
  apiUrl: 'https://flex-api.sharetribe.com',
  accessToken: 'oauth_token'
})

const client = new SharetribeConnector()

const products = await client.product.list({ page: 1, sort: '-createdAt' })

4. Build and Run the Project

Run the development server in svelte-commerce:

bun dev

To build and run the production application:

# Build the project
bun run build

# Preview the built application
bun run preview

Service coverage

| Service | Status | | --- | --- | | client.product | ✅ live | | client.category | ✅ live | | client.collection | ⚠️ placeholder (no Sharetribe equivalent) | | client.order | ✅ live | | client.coupon | ⚠️ placeholder (no Sharetribe equivalent) | | client.address | ⚠️ placeholder (no Sharetribe equivalent) | | client.review | ✅ live | | client.cart | ⚠️ placeholder (no Sharetribe equivalent) | | client.country | ⚠️ placeholder (no Sharetribe equivalent) | | client.state | ⚠️ placeholder (no Sharetribe equivalent) | | client.currency | ✅ live | | client.region | ✅ live | | client.page | ✅ live | | client.blog | ⚠️ placeholder (no Sharetribe equivalent) | | 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 Sharetribe equivalent) | | client.vendor | ✅ live | | client.checkout | ✅ live | | client.upload | ⚠️ placeholder (no Sharetribe equivalent) | | client.banner | ⚠️ placeholder (no Sharetribe equivalent) | | client.chat | ⚠️ placeholder (no Sharetribe equivalent) | | client.contact | ⚠️ placeholder (no Sharetribe equivalent) | | client.deal | ⚠️ placeholder (no Sharetribe equivalent) | | client.demoRequest | ⚠️ placeholder (no Sharetribe equivalent) | | client.enquiry | ⚠️ placeholder (no Sharetribe equivalent) | | client.faq | ⚠️ placeholder (no Sharetribe equivalent) | | client.feedback | ⚠️ placeholder (no Sharetribe equivalent) | | client.gallery | ⚠️ placeholder (no Sharetribe equivalent) | | client.home | ✅ live | | client.init | ✅ live | | client.meilisearch | ✅ live | | client.menu | ✅ live | | client.plugins | ⚠️ placeholder (no Sharetribe equivalent) | | client.popularSearch | ⚠️ placeholder (no Sharetribe equivalent) | | client.popularity | ⚠️ placeholder (no Sharetribe equivalent) | | client.reels | ⚠️ placeholder (no Sharetribe equivalent) |

Development

bun install && bun run typecheck && bun run build

License

MIT © misiki-in