npm.io
0.5.0 • Published 5h ago

@misiki/broadleaf-connector

Licence
MIT
Version
0.5.0
Deps
0
Size
2.6 MB
Vulns
0
Weekly
0

@misiki/broadleaf-connector

NPM Version License TypeScript

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

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

Coverage: 28 of 43 services are wired to the live Broadleaf Commerce API. The remaining 15 have no Broadleaf Commerce 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 broadleaf-connector and your Broadleaf backend.

1. Install the Connector

Inside your svelte-commerce project directory, run:

bun i @misiki/broadleaf-connector

(Or using npm / pnpm / yarn):

npm install @misiki/broadleaf-connector
# or
pnpm add @misiki/broadleaf-connector
2. Configure kitcommerce.config.ts

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

// kitcommerce.config.ts
export * from '@misiki/broadleaf-connector';
3. Configure Credentials

Pass apiUrl (store URL), accessToken (OAuth2 bearer token). API docs: https://developer.broadleafcommerce.com

import { BroadleafCommerceConnector } from '@misiki/broadleaf-connector'

// Credentials are set once, statically — the constructor only takes an optional fetch.
BroadleafCommerceConnector.setCredentials({
  apiUrl: 'https://store.example.com',
  accessToken: 'oauth_token'
})

const client = new BroadleafCommerceConnector()

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 live
client.order live
client.coupon live
client.address live
client.review live
client.cart live
client.country live
client.state live
client.currency live
client.region placeholder (no Broadleaf Commerce equivalent)
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 live
client.vendor live
client.checkout live
client.upload placeholder (no Broadleaf Commerce equivalent)
client.banner placeholder (no Broadleaf Commerce equivalent)
client.chat placeholder (no Broadleaf Commerce equivalent)
client.contact placeholder (no Broadleaf Commerce equivalent)
client.deal placeholder (no Broadleaf Commerce equivalent)
client.demoRequest placeholder (no Broadleaf Commerce equivalent)
client.enquiry placeholder (no Broadleaf Commerce equivalent)
client.faq placeholder (no Broadleaf Commerce equivalent)
client.feedback placeholder (no Broadleaf Commerce equivalent)
client.gallery placeholder (no Broadleaf Commerce equivalent)
client.home live
client.init live
client.meilisearch live
client.menu live
client.plugins placeholder (no Broadleaf Commerce equivalent)
client.popularSearch placeholder (no Broadleaf Commerce equivalent)
client.popularity placeholder (no Broadleaf Commerce equivalent)
client.reels placeholder (no Broadleaf Commerce equivalent)

Development

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

License

MIT misiki-in

Keywords